From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43886: 28.0.50; daemon segfaults when loading theme as second emacsclient connects Date: Fri, 09 Oct 2020 22:32:45 +0300 Message-ID: <83o8lb5h5u.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34400"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43886@debbugs.gnu.org To: Sam Brightman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 09 21:33:09 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQy8a-0008qe-RA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 21:33:08 +0200 Original-Received: from localhost ([::1]:38552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQy8Z-0007Ld-PV for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Oct 2020 15:33:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQy8U-0007LE-5W for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 15:33:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:52946) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kQy8T-0002O2-St for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 15:33:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kQy8T-000535-OP for bug-gnu-emacs@gnu.org; Fri, 09 Oct 2020 15:33:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Oct 2020 19:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43886 X-GNU-PR-Package: emacs Original-Received: via spool by 43886-submit@debbugs.gnu.org id=B43886.160227197419394 (code B ref 43886); Fri, 09 Oct 2020 19:33:01 +0000 Original-Received: (at 43886) by debbugs.gnu.org; 9 Oct 2020 19:32:54 +0000 Original-Received: from localhost ([127.0.0.1]:36259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQy8M-00052j-79 for submit@debbugs.gnu.org; Fri, 09 Oct 2020 15:32:54 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kQy8K-00052X-23 for 43886@debbugs.gnu.org; Fri, 09 Oct 2020 15:32:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50382) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQy8E-0002NM-QO; Fri, 09 Oct 2020 15:32:46 -0400 Original-Received: from [176.228.60.248] (port=4382 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kQy8E-0001Ih-2a; Fri, 09 Oct 2020 15:32:46 -0400 In-Reply-To: (message from Sam Brightman on Fri, 9 Oct 2020 16:58:38 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190174 Archived-At: > From: Sam Brightman > 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.