all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Grégory Mounié" <Gregory.Mounie@imag.fr>
To: 42676@debbugs.gnu.org
Subject: bug#42676: 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set but not XIM_Styles
Date: Sun, 2 Aug 2020 16:36:32 +0200	[thread overview]
Message-ID: <192a3177-7c2a-6200-00ae-616f9e52ab91@imag.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 552 bytes --]


  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é

[-- Attachment #2: 0001-Emacs-segfaults-if-xim-is-set-but-not-xim_styles.patch --]
[-- Type: text/x-patch, Size: 775 bytes --]

From 280e1f965e5a4d2521f2c282be6348144f687ee6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gr=C3=A9gory=20Mouni=C3=A9?= <Gregory.Mounie@imag.fr>
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


             reply	other threads:[~2020-08-02 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-02 14:36 Grégory Mounié [this message]
2020-08-02 17:24 ` bug#42676: 26.3, 27.1-rc1, master: Emacs (X11) segfaults if XIM is set but not XIM_Styles Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=192a3177-7c2a-6200-00ae-616f9e52ab91@imag.fr \
    --to=gregory.mounie@imag.fr \
    --cc=42676@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.