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 20:36:33 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13922"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "luangruo@yahoo.com" , "eliz@gnu.org" , "bschwehn@gmail.com" 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:55:07 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 1ruKMq-0003S6-Vj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Apr 2024 00:55:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruKMh-00043W-Ub; Tue, 09 Apr 2024 18:54: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 1ruKMg-00043A-MP for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:54: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 1ruKMg-0002r9-E0 for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:54:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruKMo-0000Zx-KV for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 18:55: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:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66151 X-GNU-PR-Package: emacs X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.17127032592125 (code B ref -1); Tue, 09 Apr 2024 22:55:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Apr 2024 22:54:19 +0000 Original-Received: from localhost ([127.0.0.1]:51742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruKM6-0000Y5-Gv for submit@debbugs.gnu.org; Tue, 09 Apr 2024 18:54:19 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:45962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruIDD-0008VR-EO for submit@debbugs.gnu.org; Tue, 09 Apr 2024 16:37:01 -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 1ruICx-0006KW-8P for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 16:36:43 -0400 Original-Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruICs-0006EH-AN; Tue, 09 Apr 2024 16:36:43 -0400 Original-Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-416c9158d5dso390535e9.1; Tue, 09 Apr 2024 13:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712694995; x=1713299795; darn=gnu.org; h=mime-version:content-transfer-encoding:msip_labels:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=tcBTdTQDts+NMuhoBO4+vDG33x0Ig3UUjYUWrnScv/I=; b=Mrf+Y3L4jELyKqeiyE1iprV6eYCSan9g30ujojNsv+/BfL0FC5lDPpIWx7eIc5isvy ON8uoaYfPZkkLyZ3w4lE8aYf1I1VqdV9VbQoeNdC7GpA5f0BSX2X7EGVMi0bdw82Kkpg rhxaKt2DhFhrZqkTCt58ihXKaUph3arZzypDfjrVAU2xt8W2Zw7mXDLv39enfnq+p7FW JiUTfJI8FBndwh30rOwSrBZS+ooXTQqEv6DwvLgUPl0eO+ncrk2i0/ekTHguse4VyMI6 Ct5Y998lYCG3JZ6W6PbL9w+PBBRvOeYWFKmwEz7HmNz30MZ9HabNX5yO9WcEQEPy9Xli X5vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712694995; x=1713299795; h=mime-version:content-transfer-encoding:msip_labels:content-language :accept-language:message-id:date:thread-index:thread-topic:subject :cc:to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tcBTdTQDts+NMuhoBO4+vDG33x0Ig3UUjYUWrnScv/I=; b=Y+XuSEdX7Wrc11jh//CiqAuB5e56wG4ap33QUn5mfqPvChVWNLcw6KjNV9wlf/6Q7y 5nPOl69l5QN9V+rbyj2VAAKPgNx/XM/1Zmz2goJVVEJ2GuGgL5CnnDiGgq+Xm7Hy7Uvk lAEeCrLBEneC0CeYNMzUiaT1Rw8Az6R61DOz0TXge5zJyb6BRNH94BQvUNuMD+Y14jIV S1aUVs04Rh5GvpCl8ajdu+p1Ubi8ZsH4DFA65cXaLgXEjBgsn9qFgDSgIpjJtff4aB2v ca+1MHICNLMOmJeQeFweVa+wwceJymULV1gw2JQv4jJeUEpr74nZfXYVInt8bARvFyZq n76A== X-Forwarded-Encrypted: i=1; AJvYcCXnrQ1FP4pYseZEdWPkTBivcJgoUXKuGDxDevLYTLX0/oxoJVasAYoOUh+De4JdyoltDrmqE3rCted48iQ= X-Gm-Message-State: AOJu0Yy9O/OG1e9sdNg1TW2r3daakZ91vuD1ci8lCTddnwdu7dvT0vYS 6YVQQgauC1pbe+3sE+clWGELyaxAp8fIFag1xUbRif58ICqSyP47N5MrFEn7QcMDNQ== X-Google-Smtp-Source: AGHT+IHnreG3XxO92Wh9zx7yYd2XLdK4YeVKQK0Mo1nZjLOBin7riPtM/29z0MFML5AqWFDnSGGTgA== X-Received: by 2002:a05:600c:46c6:b0:415:52df:4db1 with SMTP id q6-20020a05600c46c600b0041552df4db1mr674660wmo.7.1712694995356; Tue, 09 Apr 2024 13:36:35 -0700 (PDT) Original-Received: from LO4P123MB4589.GBRP123.PROD.OUTLOOK.COM ([2603:1026:c06:142b::5]) by smtp.gmail.com with ESMTPSA id bg14-20020a05600c3c8e00b00416b92dceaesm36562wmb.11.2024.04.09.13.36.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 13:36:34 -0700 (PDT) Thread-Topic: bug#66151: 29.1.50; daemon crashing after X forwarding disconnects Thread-Index: AQHairxOfQ9CxplYhEK5DPRJ2G7oLA== X-MS-Exchange-MessageSentRepresentingType: 1 Accept-Language: en-US Content-Language: en-US X-MS-Exchange-Organization-SCL: -1 X-MS-Exchange-Organization-RecordReviewCfmType: 0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=georgepanagopo@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 09 Apr 2024 18:54:15 -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:283015 Archived-At: Hi,=0A= =0A= I am able to reproduce this bug without launching a new emacsclient.=0A= Steps to reproduce:=0A= =0A= - Start emacs daemon.=0A= - Connect using emacsclient -c.=0A= - Connect remotely to the daemon and run another emacsclient -c using X for= warding.=0A= - Crash the X forwarding connection created in the previous step.=0A= - Go back to the emacsclient running locally on the daemon and run=0A= (set-fontset-font t '(#xe000 . #xf8ff) "Symbols Nerd Font Mono")=0A= =0A= The reason why 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, ther= e is really no good reason to run such a hook after the first frame, and th= is behavior has been fixed in Doom. (To Ben: try upgrading Doom and see if = it fixes your issue, if not let me know!)=0A= =0A= Surprisingly, the segfault still happens even if I explicitly call delete-f= rame on the dead frame before calling set-fontset-font. Also, I am unable t= o reproduce this bug without Doom (i.e. launching the daemon with -Q).=0A= =0A= I am confused as to why emacs doesn't automatically clean up frames that ha= ve 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 th= e validity of output_data.x) and remove it from the (frame-list), preventin= g any subsequent commands from acting on these frames. It has to do somethi= ng more than what delete-frame does, as that does not fix the issue (even t= hough it removes the frame from the (frame-list)).=0A= =0A= 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 cras= hes). With lucid, emacs continues to run fine with the exception of this bu= g for me.=0A=