From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Benjamin Schwehn Newsgroups: gmane.emacs.bugs Subject: bug#66151: 29.1.50; daemon crashing after X forwarding disconnects Date: Fri, 22 Sep 2023 16:28:40 +0200 Message-ID: References: <83fs3675zc.fsf@gnu.org> <87ediqpd0u.fsf@yahoo.com> <83ttrm5ovz.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="31814"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Po Lu , 66151@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 22 16:30:23 2023 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 1qjhAl-0008BD-37 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 22 Sep 2023 16:30:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjhAJ-0003Ic-F0; Fri, 22 Sep 2023 10:29: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 1qjhAH-0003H0-7g for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 10:29: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 1qjhAH-0004WN-0E for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 10:29:53 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjhAR-0002cz-68 for bug-gnu-emacs@gnu.org; Fri, 22 Sep 2023 10:30:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Benjamin Schwehn Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 22 Sep 2023 14:30:03 +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.16953929529995 (code B ref 66151); Fri, 22 Sep 2023 14:30:03 +0000 Original-Received: (at 66151) by debbugs.gnu.org; 22 Sep 2023 14:29:12 +0000 Original-Received: from localhost ([127.0.0.1]:37050 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjh9b-0002b9-KE for submit@debbugs.gnu.org; Fri, 22 Sep 2023 10:29:12 -0400 Original-Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]:58580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjh9Y-0002as-LB for 66151@debbugs.gnu.org; Fri, 22 Sep 2023 10:29:10 -0400 Original-Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-50325ce89e9so3624100e87.0 for <66151@debbugs.gnu.org>; Fri, 22 Sep 2023 07:28:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695392932; x=1695997732; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=s8mkMiY3j8bPIqRwDX//+RUBASKXYcTKlUjHkP/zg5s=; b=gjXbXoBvwKUbEjYIr6ugwtKO0wT8pxNIxbTldGTbDw/GQhzyo/Lm7phY62My4F1MPo eMAOek4rQILv1ueKFqGseSPEEIFZ1Rd3WwHQOKDBk/tDod+mtCN7/z2JyIpiC5rEnOc5 EPZY45jAT1ZibvoM2eVsyD5W7789Gik1pDyYCJwEPa7tAFzq/0O55kjV9szlgBLCKvxf 389TIbCy1IpcXvr+bamd1nfD0Y92jWzF9hrtp5pq7Ybk1ykj39+ORxvS1Z4EufuUL2Xa +dGOGJc65GNN/84zfsaACq4qx21xdK7vAhyUyWchgXfmRa3KCoiMm6ZGvGTX5I4d3Rhq cu8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695392932; x=1695997732; h=cc: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=s8mkMiY3j8bPIqRwDX//+RUBASKXYcTKlUjHkP/zg5s=; b=qIuIz8DLUBuc8JD5XwHpMf9eTy7mZWTbNX/XeqM/wKL4QeaTuNWuOeuz4eu8Ly+zu+ iiA7QHa90/7YeeaoefjP7EIkKcGXRFV2GWh18j0z3Cyh7DAAGNQTvSBrLYda7rDi9OOG 0KfnZObBZsNsFPkYaORR0EMxjyjbHxsMeawQcUW2ZiXoYWa6Pu9P0MqE1+cCp3x2+8Fv if1kE6SDBLT4NOPVoRly7V/qMmLP7N9JUP7eqEO9KBaFTgm7nPeX4nNBccn92K6KQhYk 8ojN9i2EUVBwb/V4LPw5yJcJwhsry9LeUcmRvKfiQk2vm2mCIQ0amAoqH2fuF9JsIbeY 7Pew== X-Gm-Message-State: AOJu0YxcOv3XRudXOJ9nMrTKIU9p+taqewcrgP/xJ2GElGrMeM+Fhvae Hr4TGV2PmFfSaVbL6L+G6LnZu3CxtCEfRZ6d3B4= X-Google-Smtp-Source: AGHT+IGSiRVKEfkc+c+3t0zAbRhLsBe5NVBjS3daKY/+V6wZtvljsfgCU7q5jrLTQkfDbNigMFJSj0YYfkONrrod7/Q= X-Received: by 2002:a05:6512:ac7:b0:503:2891:444d with SMTP id n7-20020a0565120ac700b005032891444dmr9449768lfu.64.1695392931689; Fri, 22 Sep 2023 07:28:51 -0700 (PDT) In-Reply-To: <83ttrm5ovz.fsf@gnu.org> 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:271103 Archived-At: Thanks a lot for helping me with this! > > - emacs running as daemon via systemd user service > > - running "emacsclient -nc" via ssh -X session > > - stop X server on client machine or cut network connection between > > client and server > > - run emacsclient -nc again > > > > Result: > > emacs window opens for about a second, then the daemon crashes. > > Does this happen with any emacsclient command in this situation? What > if you don't use -c, for example, or use -t instead? emacsclient -t also causes the crash, with this backtrace (looks the same to me) emacs_backtrace at /home/ben/install/emacs/emacs/src/sysdep.c:2304 terminate_due_to_signal at /home/ben/install/emacs/emacs/src/emacs.c:458 deliver_process_signal at /home/ben/install/emacs/emacs/src/sysdep.c:1741 (inlined by) deliver_fatal_signal at /home/ben/install/emacs/emacs/src/sysdep.c:1789 deliver_thread_signal.constprop.0 at /home/ben/install/emacs/emacs/src/sysdep.c:1765 ?? ??:0 make_lisp_ptr at /home/ben/install/emacs/emacs/src/lisp.h:1364 (inlined by) realize_default_face at /home/ben/install/emacs/emacs/src/xfaces.c:5802 (inlined by) realize_basic_faces at /home/ben/install/emacs/emacs/src/xfaces.c:5736 recompute_basic_faces at /home/ben/install/emacs/emacs/src/xfaces.c:682 (inlined by) recompute_basic_faces at /home/ben/install/emacs/emacs/src/xfaces.c:677 (inlined by) free_realized_fontsets at /home/ben/install/emacs/emacs/src/fontset.c:1345 Fset_fontset_font at /home/ben/install/emacs/emacs/src/fontset.c:1696 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2515 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 (inlined by) Flet at /home/ben/install/emacs/emacs/src/eval.c:1026 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 (inlined by) prog_ignore at /home/ben/install/emacs/emacs/src/eval.c:447 (inlined by) Fwhile at /home/ben/install/emacs/emacs/src/eval.c:1047 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 (inlined by) Flet at /home/ben/install/emacs/emacs/src/eval.c:1026 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2593 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2449 eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2593 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 (inlined by) funcall_lambda at /home/ben/install/emacs/emacs/src/eval.c:3233 Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 funcall_nil at /home/ben/install/emacs/emacs/src/eval.c:2679 run_hook_with_args at /home/ben/install/emacs/emacs/src/eval.c:2822 Frun_hooks at /home/ben/install/emacs/emacs/src/eval.c:2700 (discriminator 3) eval_sub at /home/ben/install/emacs/emacs/src/eval.c:2472 Fprogn at /home/ben/install/emacs/emacs/src/eval.c:436 (inlined by) funcall_lambda at /home/ben/install/emacs/emacs/src/eval.c:3233 Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 funcall_nil at /home/ben/install/emacs/emacs/src/eval.c:2679 run_hook_with_args at /home/ben/install/emacs/emacs/src/eval.c:2822 Frun_hooks at /home/ben/install/emacs/emacs/src/eval.c:2700 (discriminator 3) Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 ?? ??:0 funcall_subr at /home/ben/install/emacs/emacs/src/eval.c:3046 exec_byte_code at /home/ben/install/emacs/emacs/src/bytecode.c:809 Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 ?? ??:0 Ffuncall at /home/ben/install/emacs/emacs/src/eval.c:2997 safe_free at /home/ben/install/emacs/emacs/src/lisp.h:5373 (inlined by) Fapply at /home/ben/install/emacs/emacs/src/eval.c:2668 > > >> deliver_thread_signal.constprop.0 at > > >> /home/ben/install/emacs/emacs/src/sysdep.c:1765 > > >> ?? ??:0 > > >> make_lisp_ptr at /home/ben/install/emacs/emacs/src/lisp.h:1364 > > >> (inlined by) realize_default_face at > > >> /home/ben/install/emacs/emacs/src/xfaces.c:5802 > > >> (inlined by) realize_basic_faces at > > >> /home/ben/install/emacs/emacs/src/xfaces.c:5736 > > > > > > The segfault seems to be caused by the frame's output_data.x being > > > NULL or invalid. Po Lu, is this caused by stopping the server or > > > cutting the network connection between client and server? If so, is > > > there any remedy? > > > > The cause is the network connection being cut. If a display disconnect > > transpires while Emacs is operating on live frames connected to that > > display, Emacs will crash, as the Xlib error handler deletes such frames > > promptly. There are no simple solutions or means of circumventing this > > problem. > > I think in this case there were no live frames connected to the > display, only the initial (non-GUI) daemon frame. Benjamin, is that > true? The crash is triggered when a live frame was connected when the network connection was cut, but the crash happens only later, the next time I open a frame. But I am not fully sure I correctly understand the question. Let me try to explain better the circumstances: I have emacs running in server mode on a VM. I have a windows machine running an X server. Both machines are connected via a VPN which somtimes loses connection. The issues comes after this connection loss. To reproduce I do this: 1. ssh -X into the machine and run emacsclient -nc. Emacs frame opens on the client (windows) machine. 2. While the frame is open, I disconnect (C-d, C-c in the terminal that has the ssh -X connection). 3. I reconnect to the server via ssh. At this point, the emacs server process has not yet crashed. 4. I run emacsclient -nc 5. On the client machine, an emacs frame opens and does some initial draw, then the server process crashes If in step 4, I run emacclient -t instead, the server process also crashes. I can't see an initial draw happening in this case. If in step 2, I first close the frame, then disconnect, the crash in step 5 does not happen (neither for -nc nor -t) and opening a frame works fine. It's not a terrible issue for me, but annoyingly happens every time the VPN connection is lost (~twice a day) and I have emacs open (~all the time :)). Thanks, Ben