From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: George P Newsgroups: gmane.emacs.bugs Subject: bug#66151: 29.1.50; daemon crashing after X forwarding disconnects Date: Tue, 9 Apr 2024 12:28:03 -0500 Message-ID: References: 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="11089"; mail-complaints-to="usenet@ciao.gmane.io" To: 66151@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 10 00:54:31 2024 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 1ruKMJ-0002gf-90 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 00:54:31 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruKLl-0003c7-6s; Tue, 09 Apr 2024 18:53:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ruKLj-0003am-7h for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:53:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruKLi-0002aA-E3 for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:53:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruKLq-0000Vh-LH for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: George P Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2024 22:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66151 X-GNU-PR-Package: emacs Original-Received: via spool by 66151-submit@debbugs.gnu.org id=B66151.17127032371936 (code B ref 66151); Tue, 09 Apr 2024 22:54:02 +0000 Original-Received: (at 66151) by debbugs.gnu.org; 9 Apr 2024 22:53:57 +0000 Original-Received: from localhost ([127.0.0.1]:51725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruKLl-0000V3-4Y for submit@debbugs.gnu.org; Tue, 09 Apr 2024 18:53:57 -0400 Original-Received: from mail-yw1-x1132.google.com ([2607:f8b0:4864:20::1132]:59428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruFGm-000404-Aa for 66151@debbugs.gnu.org; Tue, 09 Apr 2024 13:28:29 -0400 Original-Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-6181237230dso23660007b3.2 for <66151@debbugs.gnu.org>; Tue, 09 Apr 2024 10:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712683694; x=1713288494; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=rhglhIAl2iHOiT0gpBr900AxhdxP1anpSud8yW5da2Y=; b=T++GLoU57stGie+sN/I/PqnLfVQCXSjXDKBOqjUJte9s/xEOHiZucPY+OUAKJDQL4d rJdaWxom9vbxuZMeBBYAgPIH6h+d+B3okT3SIQFaa+GxGyPUt+tNKoxXXSWwIDFiZm7Y 27lqvDrqAT0FiOQUzhI5X/zt4zZwpH08O625GrjBzUvD1jS5OtEFtXw/FEw5IunHrfTU +mVCQC9x1b1QruZLp9ZqIU6TGxRpknGOzv/kxikhNZERDufymBEmI2M1UEp5cicW7x4D h+i0/lzXxxke4Lxkrr8KmfNx9KcqFDSI9HpkTjgiN5Fo+C6OgDX4z7Lw5AITTGUuh2GB Ydyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712683694; x=1713288494; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rhglhIAl2iHOiT0gpBr900AxhdxP1anpSud8yW5da2Y=; b=wGC2FmMaDBrcBfs+ynSvNHpL0pCiDj8br74kYRWcUw6kJXSHy8fTkJwLSX2gnbfowF OFcRZQAuSZhW0BzoX3SG06iwgdx/WxLRwKUP/yevaFMtlnvys0cc+iKqQgQK5ViNEGhN AOVSe6Cgy5e+Jz0LH36Yz/Tv5TsvysvEeVDPH/3ABGURBVT5C+aWc2ML3g2dzQCFmqsr +0XGG47G5T26KajdEQ8P6dJNAZHoPQQZkQ7G62kq47kOOO3tIdKAM/ghnSy/nBJaAzGB 2VIOGA7pfMbM/jMaR/cS9rpy3o+tXdcmKnzd9mzgbsQyvXkBUFrVBlHwaov0+crZ4T84 zZXg== X-Gm-Message-State: AOJu0YwFqfAizDqdvRuJLn+YIr8dvAHlG9ySlVxuNGwTs+OTPQyxkaTu /W7V0tUqgBk1dUvke7uFSRYkLIkqT8OdSFcrN6aaZmfFGxY8H9SMLHA51uulOVF207x41IUvN4J 4JZS5/Uqh597iPRAJ35cUUZtYvq+cpm2IbVSf+w== X-Google-Smtp-Source: AGHT+IERh3P3Zj5c56wvpLdGhRmp2t2FgHsg85ZSYuhuO61H2Lupbn6oIgtmoR8KRP8dJNWK2TED6Z/JNmjQgqmeL7I= X-Received: by 2002:a0d:d6cc:0:b0:614:2da9:4a83 with SMTP id y195-20020a0dd6cc000000b006142da94a83mr411781ywd.9.1712683694348; Tue, 09 Apr 2024 10:28:14 -0700 (PDT) In-Reply-To: X-Mailman-Approved-At: Tue, 09 Apr 2024 18:53:54 -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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283014 Archived-At: Hi, I am able to reproduce this bug without launching a new emacsclient. Steps to reproduce: - Start emacs daemon. - Connect using emacsclient -c. - Connect remotely to the daemon and run another emacsclient -c using X forwarding. - Crash the X forwarding connection created in the previous step. - Go back to the emacsclient running locally on the daemon and run (set-fontset-font t '(#xe000 . #xf8ff) "Symbols Nerd Font Mono") The reason that Ben was seeing a crash with a new emacsclient is because he is using Doom (an Emacs framework) that attached a function to server-after-make-hook that called set-fontset-font in the above way. As Eli said, there is really no good reason to run such a hook after the first frame, and this behavior has been fixed in Doom. (To Ben: try upgrading Doom and see if it fixes your issue, if not let me know!) Surprisingly, the segfault still happens even if I explicitly call delete-frame on the dead frame before calling set-fontset-font. Also, I am unable to reproduce this bug without Doom (i.e. launching the daemon with -Q). I am confused as to why emacs doesn't automatically clean up frames that have been disconnected like this. If emacs survives a crash of the X server, it should be able to identify that the display is dead (e.g. by checking the validity of output_data.x) and remove it from the (frame-list), preventing any subsequent commands from acting on these frames. It has to do something more than what delete-frame does, as that does not fix the issue (even though it removes the frame from the (frame-list)). Note: using GTK is very different, as emacs crashes *without* having to run set-fontset-font (i.e. emacs crashes when the X forwarding connection crashes). With lucid, emacs continues to run fine with the exception of this bug for me.