From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#74902: 31.0.50; Segfault when deleting frames Date: Sat, 28 Dec 2024 13:35:41 +0200 Message-ID: <865xn4t4z6.fsf@gnu.org> References: <87frmoy5aq.fsf@stebalien.com> <861py7r5jq.fsf@gnu.org> <87v7vjk3nl.fsf@stebalien.com> <87frmn5yu5.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29948"; mail-complaints-to="usenet@ciao.gmane.io" Cc: steven@stebalien.com, 74902@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 28 12:36:14 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 1tRV77-0007Zc-5M for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 28 Dec 2024 12:36:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tRV6y-0003pG-Qx; Sat, 28 Dec 2024 06:36:04 -0500 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 1tRV6x-0003ow-1q for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:36:04 -0500 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 1tRV6w-0008Uw-Pp for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:36:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=N/1zMUnjFMe/QQjWcgmF9pKXofYpXOz0k6Vi13rw/wA=; b=BRcAQY/fWu5hKwwqTE4UKBlfUlEHnFxjyYlRmharqkMfGNqSoE1/0At4uoc89ydnIY7zE0iy3VY2UlS9fBp6sqeyS6ZTCLwEWymPkklUsUcgSrolTj0DFKreAwCSZZgKAgpJTOIXtJD/fi3ccHTeg5L6khyPrgJ0l7tWCZ3qCfJvx0T6ulWsoeUpkqhu9/BkiURp9393Cku+2dH9zxRwkslpWK3dbXopdNUBgcWcgdqGBd3M0xhGa79DGOvQjJuXxn1UJNsYIzpC5jwQiJ73OEoBASX3Gf7Zdg3vfx8c9Mi7cWnGdeA5pzqB329iUkWeBCZI30nR/yRXGgHRJltprw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tRV6w-0008Le-J9 for bug-gnu-emacs@gnu.org; Sat, 28 Dec 2024 06:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 28 Dec 2024 11:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74902 X-GNU-PR-Package: emacs Original-Received: via spool by 74902-submit@debbugs.gnu.org id=B74902.173538576132083 (code B ref 74902); Sat, 28 Dec 2024 11:36:02 +0000 Original-Received: (at 74902) by debbugs.gnu.org; 28 Dec 2024 11:36:01 +0000 Original-Received: from localhost ([127.0.0.1]:49496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRV6u-0008LO-Ol for submit@debbugs.gnu.org; Sat, 28 Dec 2024 06:36:01 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tRV6t-0008LA-AT for 74902@debbugs.gnu.org; Sat, 28 Dec 2024 06:35:59 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tRV6n-0008Tf-UC; Sat, 28 Dec 2024 06:35:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=N/1zMUnjFMe/QQjWcgmF9pKXofYpXOz0k6Vi13rw/wA=; b=UFTY5MEvzLtI BONoMQ7pblNvsvEPgXaOQfZQ4j2PNLHpIHYkXRM35M1zhazFSmHsBllgCTBVV374R4B0zJGbBVf0q jirrwiG4m/oSiReYr2QVoZF+Y1cnKYb7jwcw/1dH2+0tvXG5bYeeO2t4qzRabdNm2rThmrUsJlj6d /1Zlr5EfRcNN/zUAicyhyIiDaCH8SZa8AejN8QjkoGeeGfxYuSJilpvV3ONeVfTnmJJbivGL7thpc VzkljX3oPupevHeVo1OfY94ZunMygzWpMNL3IHqkAg4bBiGegO9GLhkkk1wl/FQeeL/9HrXRW5PuW 65IATvXtqFBXse5afcUTcQ==; In-Reply-To: <87frmn5yu5.fsf@gmail.com> (message from Robert Pluim on Mon, 16 Dec 2024 18:20:34 +0100) 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:297886 Archived-At: > From: Robert Pluim > Cc: Steven Allen , 74902@debbugs.gnu.org > Date: Mon, 16 Dec 2024 18:20:34 +0100 > > >>>>> On Mon, 16 Dec 2024 08:12:46 -0800, Steven Allen via "Bug reports for GNU Emacs, the Swiss army knife of text editors" said: > > Steven> Eli Zaretskii writes: > >>> As far as I can tell, this is because `delete-frame' calls `delq' (from > >>> C) which then handles a signal (not sure what signal) via the > >>> `FOR_EACH_TAIL' macro while deleting the frame. Unfortunately, that > >>> eventually calls `gobble_input' which operates on frames. > >>> > >>> > >>> Backtrace: > >>> > >>> /usr/bin/emacs(emacs_backtrace+0x4e) [0x61e77935447e] > >>> /usr/bin/emacs(terminate_due_to_signal+0xaf) [0x61e7791a4c5d] > >>> /usr/bin/emacs(+0x5e062) [0x61e7791a6062] > >>> /usr/lib/libc.so.6(+0x42150) [0x7e3a544dc150] > >>> /usr/bin/emacs(+0xeff78) [0x61e779237f78] > >>> /usr/bin/emacs(+0x19a564) [0x61e7792e2564] > >>> /usr/bin/emacs(+0x19a829) [0x61e7792e2829] > >>> /usr/bin/emacs(+0x1a1c58) [0x61e7792e9c58] > >>> /usr/bin/emacs(+0x1b0bb8) [0x61e7792f8bb8] > >>> /usr/bin/emacs(gobble_input+0x272) [0x61e77933f3a2] > >>> /usr/bin/emacs(probably_quit+0xc6) [0x61e7793ec666] > >>> /usr/bin/emacs(Fdelq+0xb6) [0x61e77940c196] > >>> /usr/bin/emacs(delete_frame+0x2d4) [0x61e7791d77b4] > >>> /usr/bin/emacs(Fdelete_frame+0x17) [0x61e7791d8a07] > >> > >> This is less useful than a backtrace could be. Can you run Emacs > >> under GDB, and when it crashes, type > >> > >> (gdb) thread apply all bt > >> > >> and post here everything GDB produces as result? > > Steven> Yeah, I agree. I'll do that if I can find a reliable way to reproduce > Steven> it. At the moment it happens once every few months. > > If you do find a reproducer, then based on the trace above I think the > following should fix it: > > diff --git a/src/frame.c b/src/frame.c > index f6053fca3ef..ff9e1d24ea1 100644 > --- a/src/frame.c > +++ b/src/frame.c > @@ -2281,7 +2281,9 @@ delete_frame (Lisp_Object frame, Lisp_Object force) > delete_all_child_windows (f->root_window); > fset_root_window (f, Qnil); > > + block_input(); > Vframe_list = Fdelq (frame, Vframe_list); > + unblock_input(); > SET_FRAME_VISIBLE (f, 0); > > /* Allow the vector of menu bar contents to be freed in the next Robert, I think you should install this on the master branch. Thanks.