GNU bug report logs - #43886
28.0.50; daemon segfaults when loading theme as second emacsclient connects

Previous Next

Package: emacs;

Reported by: Sam Brightman <sam.brightman <at> gmail.com>

Date: Fri, 9 Oct 2020 16:38:02 UTC

Severity: normal

Found in version 28.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Sam Brightman <sam.brightman <at> gmail.com>
Cc: 43886 <at> debbugs.gnu.org
Subject: bug#43886: 28.0.50; daemon segfaults when loading theme as second emacsclient connects
Date: Fri, 09 Oct 2020 22:32:45 +0300
> From: Sam Brightman <sam.brightman <at> gmail.com>
> Date: Fri, 9 Oct 2020 16:58:38 +0100
> 
> 1. Start emacs -Q -l test.el --fg-daemon. (see test.el below)
> 2. Connect with emacsclient -t.
> 3. Suspend the first client.
> 4. Connect with another emacsclient -t.
> 5. Server crashes.
> 
> I've seen other variations, and sometimes seen many clients connect
> without issue and then suddenly another one causes it to crash. This
> method appears to reproduce every time. I am connecting the client
> from another mate-terminal tab. It also works in the same terminal
> with --bg-daemon.
> 
> test.el:
> 
> (defun my/after-make-frame-functions-hook (frame)
>   (with-selected-frame frame
>     (load-theme 'tango-dark t)))
> 
> (if (daemonp)
>     (add-hook 'after-make-frame-functions 'my/after-make-frame-functions-hook))

This after-make-frame-function makes no sense: a theme is turned on or
off globally, so you don't need to do that for every frame, just for
the first one.

Of course, Emacs shouldn't crash, so I have now made a change on the
emacs-27 branch which should simply signal an error in this case (it
is possible you will not see the error message, just see the 2nd
client exit immediately).

(In general, when a TTY frame is suspended, doing anything that
iterates over all the frames might produce surprising results.)

Thanks.




This bug report was last modified 4 years and 228 days ago.

Previous Next


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