unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Sam Brightman <sam.brightman@gmail.com>
Cc: 43886@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	[thread overview]
Message-ID: <83o8lb5h5u.fsf@gnu.org> (raw)
In-Reply-To: <CAHBL1jh6-FKdNzxjJyszP_bgPfCiK+4WAOFj-y5XG8gTrV-KzA@mail.gmail.com> (message from Sam Brightman on Fri, 9 Oct 2020 16:58:38 +0100)

> From: Sam Brightman <sam.brightman@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.





  reply	other threads:[~2020-10-09 19:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-09 15:58 bug#43886: 28.0.50; daemon segfaults when loading theme as second emacsclient connects Sam Brightman
2020-10-09 19:32 ` Eli Zaretskii [this message]
2020-10-10  7:09   ` Sam Brightman
2020-10-10  7:21     ` Eli Zaretskii
2020-10-10  8:17       ` Eli Zaretskii
2020-10-10 13:27         ` Sam Brightman
2020-10-10 13:35           ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=83o8lb5h5u.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=43886@debbugs.gnu.org \
    --cc=sam.brightman@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).