From unknown Mon Jun 16 23:39:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#42676 <42676@debbugs.gnu.org> To: bug#42676 <42676@debbugs.gnu.org> Subject: Status: 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set but not XIM_Styles Reply-To: bug#42676 <42676@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:39:12 +0000 retitle 42676 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set b= ut not XIM_Styles reassign 42676 emacs submitter 42676 Gr=C3=A9gory Mouni=C3=A9 severity 42676 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 02 10:36:50 2020 Received: (at submit) by debbugs.gnu.org; 2 Aug 2020 14:36:50 +0000 Received: from localhost ([127.0.0.1]:43116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2F6X-0007wm-Vd for submit@debbugs.gnu.org; Sun, 02 Aug 2020 10:36:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:50598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2F6V-0007wZ-TO for submit@debbugs.gnu.org; Sun, 02 Aug 2020 10:36:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2F6V-00022a-My for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 10:36:47 -0400 Received: from zm-mta-out-3.u-ga.fr ([152.77.200.56]:51434) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k2F6O-0005vs-7F for bug-gnu-emacs@gnu.org; Sun, 02 Aug 2020 10:36:46 -0400 Received: from zm-mta-out.u-ga.fr (zm-mta-out.u-ga.fr [152.77.200.53]) by zm-mta-out-3.u-ga.fr (Postfix) with ESMTP id 11D5F40FD5 for ; Sun, 2 Aug 2020 16:36:35 +0200 (CEST) Received: from smtps.univ-grenoble-alpes.fr (smtps3.u-ga.fr [195.83.24.62]) by zm-mta-out.u-ga.fr (Postfix) with ESMTP id 0B4598082A for ; Sun, 2 Aug 2020 16:36:35 +0200 (CEST) Received: from [192.168.1.14] (unknown [88.126.6.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: mounieg@univ-grenoble-alpes.fr) by smtps.univ-grenoble-alpes.fr (Postfix) with ESMTPSA id DD38D40008 for ; Sun, 2 Aug 2020 16:36:34 +0200 (CEST) To: bug-gnu-emacs@gnu.org From: =?UTF-8?Q?Gr=c3=a9gory_Mouni=c3=a9?= Subject: 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set but not XIM_Styles Message-ID: <192a3177-7c2a-6200-00ae-616f9e52ab91@imag.fr> Date: Sun, 2 Aug 2020 16:36:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------25385C118CEE4AF6A79AB4A1" Content-Language: en-US X-Greylist: Whitelist-UGA SMTP Authentifie (mounieg@univ-grenoble-alpes.fr) via submission-587 ACL (100) Received-SPF: neutral client-ip=152.77.200.56; envelope-from=Gregory.Mounie@imag.fr; helo=zm-mta-out-3.u-ga.fr X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/02 10:36:35 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) This is a multi-part message in MIME format. --------------25385C118CEE4AF6A79AB4A1 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello Emacs (emacs -Q with X11) segfaults in xfns.c (create_frame_xic), at its initialization, if XIM pointer is set, but not XIM_styles pointer. The patch extends the check on xim pointer to add the XIM_Styles pointer too. The code is at least several years old (git blame write "2014-03" in 26.3 branch). The bug is present in master, 27.1-rc1 and 26.3 branch. The bug triggers today in my settings (emacs 26.3 from my debian/sid with gdm3 and windowmaker), but I do not know exactly why yet. Have a nice day Grégory Mounié --------------25385C118CEE4AF6A79AB4A1 Content-Type: text/x-patch; charset=UTF-8; name="0001-Emacs-segfaults-if-xim-is-set-but-not-xim_styles.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Emacs-segfaults-if-xim-is-set-but-not-xim_styles.patch" >From 280e1f965e5a4d2521f2c282be6348144f687ee6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Mouni=C3=A9?= Date: Sun, 2 Aug 2020 15:56:33 +0200 Subject: [PATCH] Emacs segfaults if xim is set but not xim_styles Emacs segfaults at the X11 initialization if XIM is set and xim_styles is NULL. * src/xfns.c: Check also if FRAME_X_XIM_STYLES(f) is NULL --- src/xfns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xfns.c b/src/xfns.c index 2ab5080d97..09dcbbfb92 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2652,7 +2652,7 @@ create_frame_xic (struct frame *f) goto out; xim = FRAME_X_XIM (f); - if (!xim) + if (!xim || ! FRAME_X_XIM_STYLES(f)) goto out; /* Determine XIC style. */ -- 2.28.0 --------------25385C118CEE4AF6A79AB4A1-- From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 02 13:24:02 2020 Received: (at control) by debbugs.gnu.org; 2 Aug 2020 17:24:02 +0000 Received: from localhost ([127.0.0.1]:43319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2HiL-0007uL-Mq for submit@debbugs.gnu.org; Sun, 02 Aug 2020 13:24:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2HiJ-0007u2-E0; Sun, 02 Aug 2020 13:24:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53495) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2HiD-0004MR-Gy; Sun, 02 Aug 2020 13:23:53 -0400 Received: from [176.228.60.248] (port=4723 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k2HiD-0002Fc-0f; Sun, 02 Aug 2020 13:23:53 -0400 Date: Sun, 02 Aug 2020 20:23:36 +0300 Message-Id: <83o8ntarmv.fsf@gnu.org> From: Eli Zaretskii To: Yichao Yu In-Reply-To: (message from Yichao Yu on Sun, 2 Aug 2020 09:22:53 -0400) Subject: Re: bug#42673: 26.3; Return value of XGetIMValues not checked in xim_open_dpy (src/xterm.c) References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: 42673@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 42673 42676 42677 thanks > From: Yichao Yu > Date: Sun, 2 Aug 2020 09:22:53 -0400 > Cc: Yichao Yu > > The call in question is at > https://git.savannah.gnu.org/cgit/emacs.git/tree/src/xterm.c?id=9fe2bdb88a4ebd4b2286c1c2a2a2ba7411af01b6#n10316 > Since the return value isn't checked, a failure to initialize here can > cause `dpyinfo->xim_styles` to be `NULL` which intern cause readers > like https://git.savannah.gnu.org/cgit/emacs.git/tree/src/xfns.c?id=9fe2bdb88a4ebd4b2286c1c2a2a2ba7411af01b6#n2659 > to pass a `NULL` pointer to `best_xim_style` and crash. > > The fix is to check if the return value of `XGetIMValues` is not > `NULL` and if it is not `NULL`, disable XIM. Thanks, other people also reported this, so this is now fixed on the emacs-27 branch. From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 02 13:24:32 2020 Received: (at 42676-done) by debbugs.gnu.org; 2 Aug 2020 17:24:32 +0000 Received: from localhost ([127.0.0.1]:43324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2Hiq-0007vN-AQ for submit@debbugs.gnu.org; Sun, 02 Aug 2020 13:24:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k2Hip-0007vC-N7 for 42676-done@debbugs.gnu.org; Sun, 02 Aug 2020 13:24:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53508) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k2Hii-0004QB-UC; Sun, 02 Aug 2020 13:24:24 -0400 Received: from [176.228.60.248] (port=4758 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k2Hii-0002Hg-EC; Sun, 02 Aug 2020 13:24:24 -0400 Date: Sun, 02 Aug 2020 20:24:10 +0300 Message-Id: <83mu3darlx.fsf@gnu.org> From: Eli Zaretskii To: =?utf-8?Q?Gr=C3=A9gory_Mouni=C3=A9?= In-Reply-To: <192a3177-7c2a-6200-00ae-616f9e52ab91@imag.fr> (Gregory.Mounie@imag.fr) Subject: Re: bug#42676: 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set but not XIM_Styles References: <192a3177-7c2a-6200-00ae-616f9e52ab91@imag.fr> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42676-done Cc: 42676-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Grégory Mounié > > Date: Sun, 2 Aug 2020 16:36:32 +0200 > > Emacs (emacs -Q with X11) segfaults in xfns.c (create_frame_xic), at > its initialization, if XIM pointer is set, but not XIM_styles pointer. > > The patch extends the check on xim pointer to add the XIM_Styles > pointer too. Thanks, I installed this change. From unknown Mon Jun 16 23:39:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 31 Aug 2020 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator