GNU bug report logs - #2147
Crash when adding (font . nil) to `default-frame-alist'

Previous Next

Package: emacs;

Reported by: Herbert Euler <herberteuler <at> hotmail.com>

Date: Mon, 2 Feb 2009 03:15:03 UTC

Severity: normal

Found in version 23.0.90.1

Done: Chong Yidong <cyd <at> stupidchicken.com>

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 2147 in the body.
You can then email your comments to 2147 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-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:
bug#2147; Package emacs. (Mon, 02 Feb 2009 03:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Herbert Euler <herberteuler <at> hotmail.com>:
New bug report received and forwarded. Copy sent to Emacs Bugs <bug-gnu-emacs <at> gnu.org>. (Mon, 02 Feb 2009 03:15:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Herbert Euler <herberteuler <at> hotmail.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: Default font in Emacs
Date: Mon, 2 Feb 2009 11:06:35 +0800
Package: Emacs
Version: 23.0.90.1
 
Because I prefer the FreeMono font to the default font provided, I
tweak it in my ~/.emacs like this:
 
  (let ((font (cond ((eq window-system 'w32)
                      "-outline-courier new-normal-r-normal-normal-16-120-96-96-c-*-fontset-auto2"
                     )
                     ((eq window-system 'x)
                      "FreeMono-13"
                     ))))
    (set-default-font font)
    (add-to-list 'default-frame-alist `(font . ,font)))
 
When I start emacs as a daemon:
 
  $ emacs --daemon
 
The cons cell added to `default-frame-alist' seems to be '(font
. nil). This causes a segfault when running `emacsclient -c':
 
  Program received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 0xb700f700 (LWP 28215)]
  0x0806f438 in estimate_mode_line_height (f=0xa832b38, face_id=MODE_LINE_INACTIVE_FACE_ID) at xdisp.c:1646
  1646 int height = FONT_HEIGHT (FRAME_FONT (f));
  (gdb) p FRAME_FONT (f)
  $1 = (struct font *) 0x0
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx




Reply sent to Dan Nicolaescu <dann <at> ics.uci.edu>:
You have taken responsibility. (Mon, 02 Feb 2009 06:05:06 GMT) Full text and rfc822 format available.

Notification sent to Herbert Euler <herberteuler <at> hotmail.com>:
bug acknowledged by developer. (Mon, 02 Feb 2009 06:05:07 GMT) Full text and rfc822 format available.

Message #10 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Dan Nicolaescu <dann <at> ics.uci.edu>
To: Herbert Euler <herberteuler <at> hotmail.com>
Cc: 2147-done <at> debbugs.gnu.org
Subject: Re: bug#2147: Default font in Emacs
Date: Sun, 1 Feb 2009 21:57:19 -0800 (PST)
Herbert Euler <herberteuler <at> hotmail.com> writes:

  > Package: Emacs
  > Version: 23.0.90.1
  >  
  > Because I prefer the FreeMono font to the default font provided, I
  > tweak it in my ~/.emacs like this:
  >  
  >   (let ((font (cond ((eq window-system 'w32)
  >                       "-outline-courier new-normal-r-normal-normal-16-120-96-96-c-*-fontset-auto2"
  >                      )
  >                      ((eq window-system 'x)
  >                       "FreeMono-13"
  >                      ))))
  >     (set-default-font font)
  >     (add-to-list 'default-frame-alist `(font . ,font)))
  >  
  > When I start emacs as a daemon:
  >  
  >   $ emacs --daemon
  >  
  > The cons cell added to `default-frame-alist' seems to be '(font
  > . nil). 

The bug is in your .emacs

C-h v window-system RET

Documentation:
Name of window system through which the selected frame is displayed.
The value is a symbol--for instance, `x' for X windows.
The value is nil if the selected frame is on a text-only-terminal.

When "emacs --daemon" starts there's no X frame.




Message #11 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Herbert Euler <herberteuler <at> hotmail.com>
To: <dann <at> ics.uci.edu>
Cc: <2147-done <at> debbugs.gnu.org>
Subject: RE: bug#2147: Default font in Emacs
Date: Mon, 2 Feb 2009 15:00:38 +0800
>> Package: Emacs
>> Version: 23.0.90.1
>>
>> Because I prefer the FreeMono font to the default font provided, I
>> tweak it in my ~/.emacs like this:
>>
>> (let ((font (cond ((eq window-system 'w32)
>> "-outline-courier new-normal-r-normal-normal-16-120-96-96-c-*-fontset-auto2"
>> )
>> ((eq window-system 'x)
>> "FreeMono-13"
>> ))))
>> (set-default-font font)
>> (add-to-list 'default-frame-alist `(font . ,font)))
>>
>> When I start emacs as a daemon:
>>
>> $ emacs --daemon
>>
>> The cons cell added to `default-frame-alist' seems to be '(font
>> . nil).
>
> The bug is in your .emacs
>
> C-h v window-system RET
>
> Documentation:
> Name of window system through which the selected frame is displayed.
> The value is a symbol--for instance, `x' for X windows.
> The value is nil if the selected frame is on a text-only-terminal.
>
> When "emacs --daemon" starts there's no X frame.
 
Certainly it is not a bug that the cons cell added is '(font . nil).
The bug I refered is the crash caused by adding this cons cell.  In
fact, such a crash can be reproduced by evaluating the following:
 
  (progn (add-to-list 'default-frame-alist '(font . nil))
         (make-frame-command))
 
I suggest checking the value of the `font' parameter to be added to
make sure it is valid.
 
PS: I'm sorry for my ambiguous bug report.
 
Regards,
Guanpeng Xu
 
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx



bug reopened, originator not changed. Request was from Dan Nicolaescu <dann <at> ics.uci.edu> to control <at> emacsbugs.donarmstrong.com. (Mon, 02 Feb 2009 15:10:04 GMT) Full text and rfc822 format available.

Changed bug title to `Crash when adding (font . nil) to `default-frame-alist'' from `Default font in Emacs'. Request was from Dan Nicolaescu <dann <at> ics.uci.edu> to control <at> emacsbugs.donarmstrong.com. (Mon, 02 Feb 2009 15:10:04 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> iro.umontreal.ca>:
You have taken responsibility. (Mon, 02 Feb 2009 15:45:02 GMT) Full text and rfc822 format available.

Notification sent to Herbert Euler <herberteuler <at> hotmail.com>:
bug acknowledged by developer. (Mon, 02 Feb 2009 15:45:03 GMT) Full text and rfc822 format available.

Message #20 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Herbert Euler <herberteuler <at> hotmail.com>
Cc: 2147-done <at> debbugs.gnu.org
Subject: Re: bug#2147: Default font in Emacs
Date: Mon, 02 Feb 2009 10:38:00 -0500
> Because I prefer the FreeMono font to the default font provided, I
> tweak it in my ~/.emacs like this:
 
>   (let ((font (cond ((eq window-system 'w32)
>                       "-outline-courier new-normal-r-normal-normal-16-120-96-96-c-*-fontset-auto2"
>                      )
>                      ((eq window-system 'x)
>                       "FreeMono-13"
>                      ))))
>     (set-default-font font)
>     (add-to-list 'default-frame-alist `(font . ,font)))
 
> When I start emacs as a daemon:
 
>   $ emacs --daemon
 
> The cons cell added to `default-frame-alist' seems to be '(font
> . nil). This causes a segfault when running `emacsclient -c':
 
Emacs just does what you told him to.  The same problem happens if you
start "emacs -nw" and then M-x make-frame-on-display.
In both cases `window-system' is neither `w32' nor `x' so your `font'
variable is set to nil.


        Stefan




Message #21 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Herbert Euler <herberteuler <at> hotmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: <2147-done <at> debbugs.gnu.org>, <herberteuler <at> hotmail.com>
Subject: RE: bug#2147: Default font in Emacs
Date: Tue, 3 Feb 2009 09:19:30 +0800
>> Because I prefer the FreeMono font to the default font provided, I
>> tweak it in my ~/.emacs like this:
>
>> (let ((font (cond ((eq window-system 'w32)
>> "-outline-courier new-normal-r-normal-normal-16-120-96-96-c-*-fontset-auto2"
>> )
>> ((eq window-system 'x)
>> "FreeMono-13"
>> ))))
>> (set-default-font font)
>> (add-to-list 'default-frame-alist `(font . ,font)))
>
>> When I start emacs as a daemon:
>
>> $ emacs --daemon
>
>> The cons cell added to `default-frame-alist' seems to be '(font
>> . nil). This causes a segfault when running `emacsclient -c':
>
> Emacs just does what you told him to. The same problem happens if you
> start "emacs -nw" and then M-x make-frame-on-display.
> In both cases `window-system' is neither `w32' nor `x' so your `font'
> variable is set to nil.
 
Hehe, when I combined the code in my config file that is currently not
suitable to use with terminal and the daemon usage, my intention was
really not to tell Emacs to crash  :)
 
I've changed my config file to avoid the crash and feel okay with it,
though I think in general having to change application code to avoid
certain problems such as an unnecessary crash usually indicates a
shortcoming of the program the application uses/relies on.
 
Regards,
Guanpeng Xu
_________________________________________________________________
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/photos.aspx



bug reopened, originator not changed. Request was from Stefan Monnier <monnier <at> IRO.UMontreal.CA> to control <at> emacsbugs.donarmstrong.com. (Tue, 03 Feb 2009 21:40:04 GMT) Full text and rfc822 format available.

Reply sent to Stefan Monnier <monnier <at> IRO.UMontreal.CA>:
You have taken responsibility. (Tue, 03 Feb 2009 21:40:05 GMT) Full text and rfc822 format available.

Notification sent to Herbert Euler <herberteuler <at> hotmail.com>:
bug acknowledged by developer. (Tue, 03 Feb 2009 21:40:05 GMT) Full text and rfc822 format available.

Message #28 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Herbert Euler <herberteuler <at> hotmail.com>
Cc: <2147-done <at> debbugs.gnu.org>
Subject: Re: bug#2147: Default font in Emacs
Date: Tue, 03 Feb 2009 16:32:32 -0500
> Hehe, when I combined the code in my config file that is currently not
> suitable to use with terminal and the daemon usage, my intention was
> really not to tell Emacs to crash  :)
 
Duh!  I somehow completely overlooked the fact that you got a seg-fault.
Of course, that needs to be fixed.  Thanks for insisting,


        Stefan




bug reopened, originator not changed. Request was from Stefan Monnier <monnier <at> iro.umontreal.ca> to control <at> emacsbugs.donarmstrong.com. (Wed, 04 Feb 2009 02:35:03 GMT) Full text and rfc822 format available.

Reply sent to Chong Yidong <cyd <at> stupidchicken.com>:
You have taken responsibility. (Fri, 06 Feb 2009 16:55:03 GMT) Full text and rfc822 format available.

Notification sent to Herbert Euler <herberteuler <at> hotmail.com>:
bug acknowledged by developer. (Fri, 06 Feb 2009 16:55:04 GMT) Full text and rfc822 format available.

Message #35 received at 2147-done <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Herbert Euler <herberteuler <at> hotmail.com>
Cc: 2147-done <at> debbugs.gnu.org
Subject: Re: Default font in Emacs
Date: Fri, 06 Feb 2009 11:50:04 -0500
I've checked in a fix.  Thanks for the bug report.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> emacsbugs.donarmstrong.com. (Sat, 07 Mar 2009 15:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 16 years and 192 days ago.

Previous Next


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