From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jack Kamm Newsgroups: gmane.emacs.devel Subject: Re: That old GTK bug Date: Sat, 14 Dec 2019 15:36:29 -0800 Message-ID: <87immi32f6.fsf@gmail.com> References: <0204dc49-6004-1ce1-2846-a8154b29ffc2@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20306"; mail-complaints-to="usenet@blaine.gmane.org" To: Dmitry Gutov , Eli Zaretskii , emacs-devel@gnu.org, Per =?utf-8?Q?Starb=C3=A4ck?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 15 00:38:27 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1igGzR-00058N-Bs for ged-emacs-devel@m.gmane.org; Sun, 15 Dec 2019 00:38:25 +0100 Original-Received: from localhost ([::1]:34678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGzQ-0001Jy-6t for ged-emacs-devel@m.gmane.org; Sat, 14 Dec 2019 18:38:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44271) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1igGyH-00006P-PI for emacs-devel@gnu.org; Sat, 14 Dec 2019 18:37:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1igGyG-00038x-9h for emacs-devel@gnu.org; Sat, 14 Dec 2019 18:37:13 -0500 Original-Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:38562) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1igGyB-0002su-CW; Sat, 14 Dec 2019 18:37:07 -0500 Original-Received: by mail-pl1-x643.google.com with SMTP id f20so1054066plj.5; Sat, 14 Dec 2019 15:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=WHXeWjIYUCIy+P4kQeSlL/GrNqQGfgrRgKNVPROMLHc=; b=PuVAfVF97JjYHdA6xnY0l4epSWpvWxN0/dCSjzb28FDNUqofGQKpapmePrEohKLS99 Smr7z9vcPPD8mqlYeWSY/K72xvwKMxL1PDwOlyKjV8ZXdRJxuJfW9C5mYeydFD3ftchk oHpUqXTTgGLaFSFXXCfAFWAsmSkzYDO6I8QF7aC1DMpnBDVd0FGibJdG+6GOV1RmP3uS Wjph8Iv0q7YK8IeG+o/CTTeqJJm+4b+3gDdUv/AMZpI3DubwBevBnKAFgd0mI+FR3zIa wrF6rXnnDVzXjknYk/lIK483c923uB/ZJdtHYH8vY+Ta2qaSt3pxDnfhRs1xLcjSlK3p Vu7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=WHXeWjIYUCIy+P4kQeSlL/GrNqQGfgrRgKNVPROMLHc=; b=OWm9JmBj+zjXDKImWbfEFOpIcASld9LgDQPdOx3Gpfru2ZCZnQzNe4UzjKiwecWBMw 4VxJIUlTKQM9PNqmx6Aw+9NF1zFSPWLq1qJeyNa7FhjuHUlBIY0eYB5XZB+FLyTg1N9J bESdTRT6saMmju2iKWnYnUG7zlhXjNiaOUEXCaXNr0fFuYNZTXy9KU5JFeWN4y4dh2zh sD8IWBSypMC/oRdSFjpgqFEmujZ5Wzi20rndtOpRtNwxlnonAsOXWDBvsyd2bhJkLrkZ gZrbdxTWVoPWTB73aia0+StXlp/+/ZZilF7FMDlsbrRn/OfxWw4c5urXXFsVODljp0f9 aWPA== X-Gm-Message-State: APjAAAVOE5uIpYlRYqWRxrYn6hWBiMtytCJTEcJvGHMnHcPxy2imtydw 2OrnzFZm+jKdZ49hUGcWmSU= X-Google-Smtp-Source: APXvYqwqeuv6ZODjRDuiNe4RyieQV6PsK3RXiFnzycVz/VJfRkgcHxA8twSFFu3sUKt1S0n2HSYpaw== X-Received: by 2002:a17:90a:7bc3:: with SMTP id d3mr8977457pjl.86.1576366625815; Sat, 14 Dec 2019 15:37:05 -0800 (PST) Original-Received: from localhost (199-83-220-90.PUBLIC.monkeybrains.net. [199.83.220.90]) by smtp.gmail.com with ESMTPSA id k4sm16864402pfk.11.2019.12.14.15.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2019 15:37:05 -0800 (PST) In-Reply-To: <0204dc49-6004-1ce1-2846-a8154b29ffc2@yandex.ru> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243392 Archived-At: > I think the last comment might also be implying that our problem could > now be caused by the abort() call it mentions that we keep around for > GTK 2 compatibility. I'm way out of my depth here, but would really like to use GTK emacsclient over SSH X forwarding, so decided to have a look at this. To trigger the bug, I ran "emacs --fgdaemon" on latest master (9ee5af3150) in a Debian 10 VM, then connected to it with "ssh -XY debian10 emacsclient -nc". Then, I kill the SSH connection. It crashes on the following code block in xterm.c: #ifdef USE_GTK /* A long-standing GTK bug prevents proper disconnect handling . Once, the resulting Glib error message loop filled a user's disk. To avoid this, kill Emacs unconditionally on disconnect. */ shut_down_emacs (0, Qnil); fprintf (stderr, "%s\n\ When compiled with GTK, Emacs cannot recover from X disconnects.\n\ This is a GTK bug: https://gitlab.gnome.org/GNOME/gtk/issues/221\n\ For details, see etc/PROBLEMS.\n", error_msg); emacs_abort (); #endif /* USE_GTK */ which is the abort call that the linked comment complains about when it called this issue "ridiculous". So I deleted this code block and reran my test. Emacs still crashes, but in a different location. Here's the backtrace from gdb: (gdb) bt #0 0x00007ffff49135cb in raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00005555555965f8 in terminate_due_to_signal (sig=sig@entry=6, backtrace_limit=backtrace_limit@entry=40) at emacs.c:401 #2 0x0000555555596a29 in emacs_abort () at sysdep.c:2453 #3 0x000055555559a0c7 in wait_reading_process_output (time_limit=time_limit@entry=30, nsecs=nsecs@entry=0, read_kbd=read_kbd@entry=-1, do_display=do_display@entry=true, wait_for_cell=wait_for_cell@entry=0x0, wait_proc=wait_proc@entry=0x0, just_wait_proc=0) at process.c:5691 #4 0x00005555555a656e in sit_for (timeout=timeout@entry=0x7a, reading=reading@entry=true, display_option=display_option@entry=1) at lisp.h:1032 #5 0x000055555567efba in read_char (commandflag=1, map=0x5555581c9f03, prev_event=0x0, used_mouse_menu=0x7fffffffe03b, end_time=0x0) at lisp.h:1147 #6 0x000055555567f6ac in read_key_sequence (keybuf=0x7fffffffe150, prompt=0x0, dont_downcase_last=, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=) at keyboard.c:9536 #7 0x0000555555680cec in command_loop_1 () at lisp.h:1032 #8 0x00005555556e60b2 in internal_condition_case (bfun=bfun@entry=0x555555680b10 , handlers=handlers@entry=0x90, hfun=hfun@entry=0x555555677d70 ) at eval.c:1355 #9 0x0000555555672b94 in command_loop_2 (ignore=ignore@entry=0x0) at lisp.h:1032 #10 0x00005555556e6031 in internal_catch (tag=tag@entry=0xd110, func=func@entry=0x555555672b70 , arg=arg@entry=0x0) at eval.c:1116 #11 0x0000555555672b3b in command_loop () at lisp.h:1032 #12 0x0000555555677976 in recursive_edit_1 () at keyboard.c:714 #13 0x0000555555677c95 in Frecursive_edit () at keyboard.c:786 #14 0x000055555559c91f in main (argc=2, argv=) at emacs.c:2054 (gdb) In particular, it crashes at this call to emacs_abort() in process.c: if (nfds < 0) { if (xerrno == EINTR) no_avail = 1; else if (xerrno == EBADF) emacs_abort (); else report_file_errno ("Failed select", Qnil, xerrno); } I don't know what this means, but I gather that emacs is crashing due to having a bad file descriptor. So it seems like there's still some real underlying problem here, aside from Emacs' preemptive call to abort(), and it doesn't have anything to do with GTK 2 (as I'm using GTK 3 here).