From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Brightman Newsgroups: gmane.emacs.bugs Subject: bug#43886: 28.0.50; daemon segfaults when loading theme as second emacsclient connects Date: Sat, 10 Oct 2020 08:09:56 +0100 Message-ID: References: <83o8lb5h5u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16782"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43886@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 10 09:21:10 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 1kR9Bl-0004Ff-Qp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Oct 2020 09:21:09 +0200 Original-Received: from localhost ([::1]:38974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kR9Bk-0004mh-Bt for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Oct 2020 03:21:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kR9Be-0004mV-7p for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 03:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kR9Bd-00034W-Un for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 03:21:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kR9Bd-0001Bw-RP for bug-gnu-emacs@gnu.org; Sat, 10 Oct 2020 03:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sam Brightman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Oct 2020 07:21: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.16023144104511 (code B ref 43886); Sat, 10 Oct 2020 07:21:01 +0000 Original-Received: (at 43886) by debbugs.gnu.org; 10 Oct 2020 07:20:10 +0000 Original-Received: from localhost ([127.0.0.1]:36825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kR9Ao-0001Ah-9k for submit@debbugs.gnu.org; Sat, 10 Oct 2020 03:20:10 -0400 Original-Received: from mail-lf1-f66.google.com ([209.85.167.66]:35033) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kR91C-0000vt-L0 for 43886@debbugs.gnu.org; Sat, 10 Oct 2020 03:10:16 -0400 Original-Received: by mail-lf1-f66.google.com with SMTP id 77so2828883lfl.2 for <43886@debbugs.gnu.org>; Sat, 10 Oct 2020 00:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ClDnKU938/M21v0YTjhowBwCJvtwgvI1sBjKfc6df9c=; b=PbNsRbF8wtjk3L70HMBekeVuQPI8mIYX3UiFgb47Rkd2s4FiABqny/Nz6AUWuOqyyk d5otoLKLYiSMmFaljUzeTAP+wq/R36azQrnNRGO/UNDGCiBWqBojZHQ36zRiLi/7Ki5q YBkL1wQewTaRNtT6G2yQshJf65Ix4XyOwnqWeUlmjlMta+2AeMOz+EZfirxILtFyWRMW 9XdcKKq4H8SYPfv5w/jB5NkG6DYvmzXVxsfjf8xXKbfWQq1J7YG4gk43Y1aq+AElI1yp tiwhyVObt2P7mIEAs6bugir6tpRRQc4ezks66NS35pRnrmexWXSo5qV1Fm8WvkSx4yrJ dP1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ClDnKU938/M21v0YTjhowBwCJvtwgvI1sBjKfc6df9c=; b=tQ5Rdpza2bNoKLWyAZ2z49vJ22jJLatXjY9g8d3qdzNAAIN64RY7Z0AUkiYivdMNQ3 MOuo25a/BDdBoXLFqoIWxIWn8WdbdP5UQoyrFntu9nLi9VzbFV1ybpBqmn7GAL1apWSS RYboJd0Pn7L3A5OE9MMcIrker7todzmGV1jFhkzdYO/VjpklTeWkjPbkFG7XK+4e0Un1 sMB36guLFsJ7crsZg6pWQZ20yu+GcKfnhn+W/YjcCa4UgoqMlX3SJ7eX5ltVPLOmipk7 3ygYorA02qG7/w5pL2lFhegCjWfj64z247auihPM0MPBjLVi26KYueBYO+zBbog7U8WG gF9A== X-Gm-Message-State: AOAM533NTlRajH0A9jDUA/ekhlHxnpYppeBh7xCM76X6cO/uah4LoLFR LbPH8y+yoiFBbWml9x+/LSaaDlWKErxTB6OLb6o= X-Google-Smtp-Source: ABdhPJxqDQ1my9YVbG557oRfSMmKQQ/W25FWJwxbSuPDDRrzx+yu+Vh0GAp25GgE0UW9uA3n956eKjIxSeTaFMGjpdU= X-Received: by 2002:a19:8885:: with SMTP id k127mr5023526lfd.594.1602313808464; Sat, 10 Oct 2020 00:10:08 -0700 (PDT) In-Reply-To: <83o8lb5h5u.fsf@gnu.org> X-Mailman-Approved-At: Sat, 10 Oct 2020 03:20:08 -0400 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:190195 Archived-At: That patch indeed prevents a crash but the second client exiting seems a bit strong/unhelpful - how would you suggest changing the theme more appropriately? I believe code of this type was introduced because new frames were not getting themed properly: https://stackoverflow.com/questions/18904529/after-emacs-deamon-i-can-not-see-new-theme-in-emacsclient-frame-it-works-fr Some of the later answers indeed try to avoid repeatedly loading the theme. However - even removing that hook - it is now impossible to load a theme when a client is suspended (which is basically always for me - I'll have half a dozen or more clients open at any time, one of them will be suspended). On Fri, 9 Oct 2020 at 20:32, Eli Zaretskii wrote: > > > 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. -- sam brightman