From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uHjMFuAKJ1+ZAgAA0tVLHw (envelope-from ) for ; Sun, 02 Aug 2020 18:50:08 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mDOkEuAKJ1/uDQAAB5/wlQ (envelope-from ) for ; Sun, 02 Aug 2020 18:50:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C2AEA940876 for ; Sun, 2 Aug 2020 18:50:07 +0000 (UTC) Received: from localhost ([::1]:34472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2J3e-0003VH-IF for larch@yhetil.org; Sun, 02 Aug 2020 14:50:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2J3a-0003V7-Ic for guix-patches@gnu.org; Sun, 02 Aug 2020 14:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k2J3a-0005gi-8o for guix-patches@gnu.org; Sun, 02 Aug 2020 14:50:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k2J3a-0000DZ-84 for guix-patches@gnu.org; Sun, 02 Aug 2020 14:50:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42680] [PATCH] gnu: emacs: Ignore empty XIM styles. Resent-From: Leo Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 02 Aug 2020 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 42680 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42680@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1596394196819 (code B ref -1); Sun, 02 Aug 2020 18:50:02 +0000 Received: (at submit) by debbugs.gnu.org; 2 Aug 2020 18:49:56 +0000 Received: from localhost ([127.0.0.1]:43485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2J3Q-0000D5-NF for submit@debbugs.gnu.org; Sun, 02 Aug 2020 14:49:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:36938) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2J3L-0000Cs-En for submit@debbugs.gnu.org; Sun, 02 Aug 2020 14:49:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2J3L-0003Tz-5E for guix-patches@gnu.org; Sun, 02 Aug 2020 14:49:47 -0400 Received: from mailrelay.tugraz.at ([129.27.2.202]:29343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2J3F-0005e7-DR for guix-patches@gnu.org; Sun, 02 Aug 2020 14:49:46 -0400 Received: from localhost.localdomain (213-147-177-210.hdsl.highway.telekom.at [213.147.177.210]) by mailrelay.tugraz.at (Postfix) with ESMTPSA id 4BKVRx0dKsz3wTB for ; Sun, 2 Aug 2020 20:49:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tugraz.at; s=mailrelay; t=1596394173; bh=ecwpA8ag2uIkFQezN/C4MoxXFVh+CVtIEIQIpXwWcw4=; h=From:To:Subject:Date; b=azKljj8cVkkkwpo9uecUZrayHkzzmN9LWnwkQt7ZMOsbLcNA5gXHjuFmSa41R23E3 IM9oRZKP6Ob2rln0srjEwMUopIKsO7nK6V+1hMLCiVY3VcvZdAAl5rbZIJG1kjOWWA RwO8KjhuNSYY/Yxn6wBvWjPj6xtYBv1F3pnM7vwE= From: Leo Prikler Date: Sun, 2 Aug 2020 20:46:58 +0200 Message-Id: <20200802184655.30348-1-leo.prikler@student.tugraz.at> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUG-Backscatter-control: bt4lQm5Tva3SBgCuw0EnZw X-Spam-Scanner: SpamAssassin 3.003001 X-Spam-Score-relay: -1.9 X-Scanned-By: MIMEDefang 2.74 on 129.27.10.116 Received-SPF: pass client-ip=129.27.2.202; envelope-from=leo.prikler@student.tugraz.at; helo=mailrelay.tugraz.at X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/02 14:49:34 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.3 (--) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=tugraz.at header.s=mailrelay header.b=azKljj8c; dmarc=fail reason="SPF not aligned (relaxed)" header.from=student.tugraz.at (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 5.09 X-TUID: n5spga3zOkyp As of libx11 version 1.6.10, xim may be NULL, which causes a segmentation fault in the execution of ARRAYELTS. As a cautionary measure, we short-circuit this logic. * gnu/packages/patches/emacs-ignore-empty-xim-styles.patch: New file. * gnu/packages/emacs.scm (emacs emacs-next)[patches]: Use it. * gnu/local.mk: Register it. --- gnu/local.mk | 1 + gnu/packages/emacs.scm | 2 ++ .../emacs-ignore-empty-xim-styles.patch | 21 +++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 gnu/packages/patches/emacs-ignore-empty-xim-styles.patch diff --git a/gnu/local.mk b/gnu/local.mk index 9d295267a8..0144965827 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -917,6 +917,7 @@ dist_patch_DATA = \ %D%/packages/patches/emacs-exec-path.patch \ %D%/packages/patches/emacs-exwm-fix-fullscreen-states.patch \ %D%/packages/patches/emacs-fix-scheme-indent-function.patch \ + %D%/packages/patches/emacs-ignore-empty-xim-styles.patch \ %D%/packages/patches/emacs-json-reformat-fix-tests.patch \ %D%/packages/patches/emacs-highlight-stages-add-gexp.patch \ %D%/packages/patches/emacs-hyperbole-toggle-messaging.patch \ diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm index 8fe5750791..ad8d4b0606 100644 --- a/gnu/packages/emacs.scm +++ b/gnu/packages/emacs.scm @@ -85,6 +85,7 @@ "119ldpk7sgn9jlpyngv5y4z3i7bb8q3xp4p0qqi7i5nq39syd42d")) (patches (search-patches "emacs-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" "emacs-source-date-epoch.patch")) (modules '((guix build utils))) (snippet @@ -261,6 +262,7 @@ languages.") (file-name (git-file-name name version)) (patches (search-patches "emacs27-exec-path.patch" "emacs-fix-scheme-indent-function.patch" + "emacs-ignore-empty-xim-styles.patch" "emacs-source-date-epoch.patch")) (modules (origin-modules (package-source emacs))) ;; TODO: once the snippet for `emacs' is changed to not fail when diff --git a/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch new file mode 100644 index 0000000000..936b7a81f7 --- /dev/null +++ b/gnu/packages/patches/emacs-ignore-empty-xim-styles.patch @@ -0,0 +1,21 @@ +Index: emacs-26.3/src/xfns.c +=================================================================== +--- emacs-26.3.orig/src/xfns.c ++++ emacs-26.3/src/xfns.c +@@ -2533,6 +2533,8 @@ xic_free_xfontset (struct frame *f) + static XIMStyle + best_xim_style (XIMStyles *xim) + { ++ if (xim == NULL) goto out; ++ + int i, j; + int nr_supported = ARRAYELTS (supported_xim_styles); + +@@ -2541,6 +2543,7 @@ best_xim_style (XIMStyles *xim) + if (supported_xim_styles[i] == xim->supported_styles[j]) + return supported_xim_styles[i]; + ++ out: + /* Return the default style. */ + return XIMPreeditNothing | XIMStatusNothing; + } -- 2.28.0