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: Date: Tue, 9 Apr 2024 10:02:45 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000844d780615ab3788" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10649"; 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:30 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 1ruKMH-0002dM-L5 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 00:54:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruKLj-0003ar-I1; 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 1ruKLh-0003aR-Rm for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:53:53 -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 1ruKLh-0002Zy-Jc for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:53:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruKLp-0000VT-Ow for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:54:01 -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:01 +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.17127032361907 (code B ref 66151); Tue, 09 Apr 2024 22:54:01 +0000 Original-Received: (at 66151) by debbugs.gnu.org; 9 Apr 2024 22:53:56 +0000 Original-Received: from localhost ([127.0.0.1]:51717 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruKLj-0000Uf-Cz for submit@debbugs.gnu.org; Tue, 09 Apr 2024 18:53:56 -0400 Original-Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]:49166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruD09-0003Ok-IT for 66151@debbugs.gnu.org; Tue, 09 Apr 2024 11:03:14 -0400 Original-Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-61428e80f0cso42884147b3.2 for <66151@debbugs.gnu.org>; Tue, 09 Apr 2024 08:03:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712674975; x=1713279775; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7MQOyDXLyzF9yvys6FS66h8uKu1MtkPefV71uE+7G2w=; b=Z8ng6yo3aVYm5S4RlOLmVISxUUOwV5uj+YUfJ6cnhHByB1iJphXVKyyd0tuKaMK3qY G7INRGKAOkeOWxGrnEGRPue+MHI6cZZgy9FiChizdvp0ZrEjlXnf+Y56orCEqG6suVmW TJJzoHJKVvjJfMFB3h6sedLkHLosEMgL6rfm2dnfFCJjrn95Wgm+PHwdmuXNcbP1pfFu WgMdW27wPE+a5tAOHj1ag0nNluREuRQAHPwy7ZqQJkSdXxe67pMvn1g3YkbpxbzoX7gq NqLs7dZTau5SmyzwycSrQ2p6bEFopGxl7gCxD4zzmeFe8FZxkuWMc2owKEGDoZpAnPCI 86qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712674975; x=1713279775; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7MQOyDXLyzF9yvys6FS66h8uKu1MtkPefV71uE+7G2w=; b=En084gicPa7k0dCWoAsPEzaeUY5iAtsnIjzd1S95bZwpsuzAbU8mQ8Ie65Ocx68K9M BhOdJhMlHzSkHC4+m4LT1IGJQpkCICLPR6EpDmgVoLUyeyF2oPtv5XWvciZnLfvZ+wDF zYvX3KunG5thSBxsbr6LnU5NSNXtLtQGN9jYb9d7vIU/EPM1XozrFjIBWVk2u2wje13b WoPtKv8Sx/u/sZwUAGJEy/cpefGSi94t+QUWaLsqGV0Cuq/TrkARupDZ0RxN7UgySJL/ S18xJbBSZxeHLiX/EaZaPTcenQBbu2Ie1D77q6YNLX0/PiSaTqlWScOq8gziik14FGFc 99uw== X-Gm-Message-State: AOJu0YyUS62k29OTG92hAEjPunOtFS++Z6JTvx8qjE1Tm5aga3LoV0uw tHD9+ZehcdISTLslks363m3wMPPErQQg4/RYF6cJpmd+umew5DP8WWH7AOr6z+Avq1B2if6keeN HF5WgrdTlNR8QWHQ6KjCRZBxSfUmNMiqmAFwp0CZ/ X-Google-Smtp-Source: AGHT+IFpzkU7XnPY/mAgBOESh8fJSv0BA9cLUK+Ti+YXiB8AQSaExpkxRtcn/IPBwa32rgoQfAAdRzYKt5fhhjmBwYc= X-Received: by 2002:a0d:e855:0:b0:615:35e1:e512 with SMTP id r82-20020a0de855000000b0061535e1e512mr9920155ywe.0.1712674975270; Tue, 09 Apr 2024 08:02:55 -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:283013 Archived-At: --000000000000844d780615ab3788 Content-Type: text/plain; charset="UTF-8" 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. --000000000000844d780615ab3788 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

I am able to reproduce t= his 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 create= d in the previous step.
- Go back to the emacsclient running = locally on the daemon and run=20 (set-fontset-font t '(#xe000 . #xf8ff= ) "Symbols Nerd Font Mono")

The reason that Ben was seeing a crash with a ne= w emacsclient is because he is using Doom (an Emacs framework) that attache= d 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 a= fter the first frame, and this behavior has been fixed in Doom. (To Ben: tr= y 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-fon= tset-font. Also, I am unable to reproduce this bug without Doom (i.e. launc= hing the daemon with -Q).

<= code class=3D"gmail-notranslate">I am confu= sed as to why emacs doesn't automatically clean up frames that have bee= n disconnected like this. If emacs survives a crash of the X server, it sho= uld be able to identify that the display is dead (e.g. by checking the vali= dity 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 mor= e than what delete-frame does, as that does not fix the issue (even though = it removes the frame from the (frame-list)).
<= code class=3D"gmail-notranslate">
Note: using GTK is very different, as emacs crashes *without* hav= ing to run set-fontset-font (i.e. emacs crashes when the X forwarding conne= ction crashes). With lucid, emacs continues to run fine with the exception = of this bug for me.
--000000000000844d780615ab3788--