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 10:16:09 -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="10061"; 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:23 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 1ruKMB-0002VX-EW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 00:54:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruKLj-0003bH-TR; Tue, 09 Apr 2024 18:53:55 -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 1ruKLi-0003ab-8R for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:53:54 -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-0002a4-0Q 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-0000Va-7V for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:54:02 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: 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.17127032361914 (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:56 +0000 Original-Received: from localhost ([127.0.0.1]:51719 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruKLk-0000Ui-34 for submit@debbugs.gnu.org; Tue, 09 Apr 2024 18:53:56 -0400 Original-Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]:42352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruDD7-0007DP-O9 for 66151@debbugs.gnu.org; Tue, 09 Apr 2024 11:16:35 -0400 Original-Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-615053a5252so51631537b3.1 for <66151@debbugs.gnu.org>; Tue, 09 Apr 2024 08:16:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712675780; x=1713280580; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=rhglhIAl2iHOiT0gpBr900AxhdxP1anpSud8yW5da2Y=; b=JykCV8SpYjvoc2myWpIAMy/a3Oj0mDYXecyxdFjVXk2U2nzHTY7LGRN5cShYo+hafS 1TWi1I3/cYTwVrl35AY9pdn9cp0m2ID5BpIH1W/Ixcv+tTgjnWjuk1CKfIJXE/AnfOZb 1vZbHFq8jhGvsxEsr5rq9yx1V1fjRSLVIP6CxUiEFqMsC8ZX+HLmXyzAKC3UZlVPg49c CSfYmsK2lOJehwGSLDVxSaE0jVcZZxPhMMJCGlqnonZjjstwcE1a7gdYdFm86oT3yQp3 j8RjqrPPpo3IZHs9PIIpujcAvJFFEQbvFBS229h7MWjtmITG4ZfEXMBTrM7jYPJO4xJb 7M7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712675780; x=1713280580; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rhglhIAl2iHOiT0gpBr900AxhdxP1anpSud8yW5da2Y=; b=TjVDCSQu+AyfFeTKDrjkQKFyA3cdg/0RsyqS62Wqmrtx14lK1EbeRgF6+AYFpo6g+R BG5LK54jPXJcH2RMBNM/h4iRer0mewcYgPupmgEFjj4tHHwFPtKoyW3B0NDyGEiT+/04 ULR5GHGUyFJ/xQeEEGHGI5NqNXJVAKY2yM214Smqq8kVJWuU2dmYryAOhNJxeTyBaw+w /84xxF9kidZ4DEzRaEmj0rUUUFWqqeI1LUvk3Sc88YqVyJDV2mhRq2zOz8DSqIUcD9sn 94KVW9JXtqKW8Py07PteoMLTgBv1eqiHFNrjj0L+fwfJKnNG6DqXqfznBiCRxSs8YK4r suPQ== X-Gm-Message-State: AOJu0YwW5PY+m+74tayxhw9abi+Khcw84uTV9E+e6N3LRJU6HIb6y/fm J1c6CMwRimR/6rNeXgiFao83I8c7uEljB9RlfV5xPyT66ZG02PVXjeekNrc8yjc9C5rcoqD8RLX u/zT1rK763GfAvvLQVOhopy4R3azEgzboz6de3kz/ X-Google-Smtp-Source: AGHT+IExlxNKBIdWxVIZ68aVRbV26PdnESYn7RxlaVtudv3R64APyCXKj8c4kDr7ih3qN7Kf36ZpqUooGQoPMNkNcYY= X-Received: by 2002:a05:690c:2b02:b0:610:b545:6605 with SMTP id em2-20020a05690c2b0200b00610b5456605mr1407062ywb.26.1712675779578; Tue, 09 Apr 2024 08:16:19 -0700 (PDT) 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:283012 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.