GNU bug report logs - #9999
23.3; menu related segfault when making new frame

Previous Next

Package: emacs;

Reported by: michael_heerdegen <at> web.de

Date: Wed, 9 Nov 2011 00:18:01 UTC

Severity: normal

Found in version 23.3

Done: Jan Djärv <jan.h.d <at> swipnet.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9999 in the body.
You can then email your comments to 9999 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9999; Package emacs. (Wed, 09 Nov 2011 00:18:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to michael_heerdegen <at> web.de:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 09 Nov 2011 00:18:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.3; menu related segfault when making new frame
Date: Wed, 09 Nov 2011 01:18:15 +0100
Hi,

starting with emacs -Q, when I eval the following expression:


(let* ((pop-up-frames t))
  (define-key (lookup-key global-map [menu-bar]) [foo]
    '(menu-item "Foo" ignore :enable (file-exists-p "http://www.foo.com")))
  (setq default-directory "/")
  (make-frame))


Emacs crashs.

I was able to produce the crash on different hosts.

I can provide a backtrace if needed.


In GNU Emacs 23.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2011-10-26 on murphy, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11101901
configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2''

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9999; Package emacs. (Thu, 10 Nov 2011 19:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 9999 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: michael_heerdegen <at> web.de
Cc: 9999 <at> debbugs.gnu.org
Subject: Re: bug#9999: 23.3; menu related segfault when making new frame
Date: Thu, 10 Nov 2011 20:43:06 +0100
9 nov 2011 kl. 01:18 skrev Michael Heerdegen:

> Hi,
> 

Hello.

This is what happens for me in the trunk.
x-create-frame is called.  The frame is made official by putting it in Vframe_list.
A signal is raised, so the debugger is called in a new frame.  This is also put in Vframe_list.
When we quit from the debugger, unwind_create_frame is called, and this test is done:

  /* If frame is ``official'', nothing to do.  */
  if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))

But the faulty frame isn't XCAR, the debugger frame is.
So the test fails and  x_free_frame_resources is called and eventually sets  f->output_data.x to NULL.
But the f->output_method is not reset, so when an event comes, we loop over Vframe_list and kaboom happens here:

 if (!FRAME_X_P (f) || FRAME_X_DISPLAY_INFO (f) != dpyinfo) ...

FRAME_X_P only checks if f->output_method is output_x_window, which it is, 
but FRAME_X_DISPLAY_INFO (f) is the same as f->output_data.x->display_info and as x is NULL, this crashes.

So ethier FRAME_X_P needs to be improved (ditto for all terms I guess), or unwind_create_frame needs a better check (also ditto for all terms?).

	Jan D.



> starting with emacs -Q, when I eval the following expression:
> 
> 
> (let* ((pop-up-frames t))
>  (define-key (lookup-key global-map [menu-bar]) [foo]
>    '(menu-item "Foo" ignore :enable (file-exists-p "http://www.foo.com")))
>  (setq default-directory "/")
>  (make-frame))
> 
> 
> Emacs crashs.
> 
> I was able to produce the crash on different hosts.
> 
> I can provide a backtrace if needed.
> 
> 
> In GNU Emacs 23.3.1 (i486-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
> of 2011-10-26 on murphy, modified by Debian
> Windowing system distributor `The X.Org Foundation', version 11.0.11101901
> configured using `configure  '--build' 'i486-linux-gnu' '--build' 'i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.3/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.3/site-lisp:/usr/share/emacs/site-lisp' '--with-crt-dir=/usr/lib/i386-linux-gnu' '--with-x=yes' '--with-x-toolkit=lucid' '--with-toolkit-scroll-bars' '--without-gconf' 'build_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2''
> 
> Important settings:
>  value of $LC_ALL: de_DE.utf8
>  value of $LC_COLLATE: nil
>  value of $LC_CTYPE: nil
>  value of $LC_MESSAGES: nil
>  value of $LC_MONETARY: nil
>  value of $LC_NUMERIC: nil
>  value of $LC_TIME: C
>  value of $LANG: de_DE.utf8
>  value of $XMODIFIERS: nil
>  locale-coding-system: utf-8-unix
>  default enable-multibyte-characters: t
> v
> 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9999; Package emacs. (Fri, 11 Nov 2011 02:01:01 GMT) Full text and rfc822 format available.

Message #11 received at 9999 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: michael_heerdegen <at> web.de, 9999 <at> debbugs.gnu.org
Subject: Re: bug#9999: 23.3; menu related segfault when making new frame
Date: Thu, 10 Nov 2011 20:59:39 -0500
>   /* If frame is ``official'', nothing to do.  */
>   if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))

How 'bout changing it to

  if (NILP (Fmemq (frame, Vframe_list)))

?


        Stefan




Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Fri, 11 Nov 2011 18:36:01 GMT) Full text and rfc822 format available.

Notification sent to michael_heerdegen <at> web.de:
bug acknowledged by developer. (Fri, 11 Nov 2011 18:36:02 GMT) Full text and rfc822 format available.

Message #16 received at 9999-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: michael_heerdegen <at> web.de, 9999-done <at> debbugs.gnu.org
Subject: Re: bug#9999: 23.3; menu related segfault when making new frame
Date: Fri, 11 Nov 2011 19:35:00 +0100
11 nov 2011 kl. 02:59 skrev Stefan Monnier:

>>  /* If frame is ``official'', nothing to do.  */
>>  if (!CONSP (Vframe_list) || !EQ (XCAR (Vframe_list), frame))
> 
> How 'bout changing it to
> 
>  if (NILP (Fmemq (frame, Vframe_list)))
> 
> ?

I did that in x, nd and w32.  However, I can't compile on w32, can someone just double check that it compiles?

Thanks.

	Jan D.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9999; Package emacs. (Fri, 11 Nov 2011 19:38:02 GMT) Full text and rfc822 format available.

Message #19 received at 9999 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 9999 <at> debbugs.gnu.org, jan.h.d <at> swipnet.se
Subject: Re: bug#9999: 23.3; menu related segfault when making new frame
Date: Fri, 11 Nov 2011 21:34:17 +0200
> From: Jan Djärv <jan.h.d <at> swipnet.se>
> Date: Fri, 11 Nov 2011 19:35:00 +0100
> Cc: michael_heerdegen <at> web.de, 9999-done <at> debbugs.gnu.org
> 
> 
> >  if (NILP (Fmemq (frame, Vframe_list)))
> > 
> > ?
> 
> I did that in x, nd and w32.  However, I can't compile on w32, can someone just double check that it compiles?

It does.

However, since I couldn't reproduce the original problem before this
change, I cannot say that the problem is now solved on w32.

Thanks.





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 10 Dec 2011 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 139 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.