From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#74902: 31.0.50; Segfault when deleting frames Date: Mon, 16 Dec 2024 18:20:34 +0100 Message-ID: <87frmn5yu5.fsf@gmail.com> References: <87frmoy5aq.fsf@stebalien.com> <861py7r5jq.fsf@gnu.org> <87v7vjk3nl.fsf@stebalien.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19396"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Steven Allen , 74902@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 16 18:22:22 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 1tNEnW-0004vR-3e for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 16 Dec 2024 18:22:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNEnG-0006pL-EP; Mon, 16 Dec 2024 12:22:06 -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 1tNEnD-0006oq-Ba for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:22:03 -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 1tNEnD-00018Z-3O for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:22:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=+tyZ8ug2iapkPaazXtqnArLHhj+Nu02rvRiMVwU4rt8=; b=oQl885O+iUNuwgQvXCoBbegbryCnwcdQUtM6sPsojH4zXLPZLMKGBH0Xg4PRHaU/o0pJ23UbNqszghUM+aVkysKHndLqGNVUZLK6zoSn9LefsOKCpJuKo6w6ju6McQO3/QApbb8yzuYA9S8wFXH7w4zfvT/mPEfbm0aueuC2trqvxW+dHeLoN92Pt99b/iT9WPL4SyOrAWU0m2FvH7msgUfgBi+M2A9hpf1VrmU6um+j+pPzY+IO9nfCSMfQoH3YCtBzUFJnZ24JIs1yObFJM73yoBhVIbDRknoua06O22UXXzLuTluvktG8hhVfEi7S2hEwGfObztLScg9fDsZqdA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tNEnC-0005u7-62 for bug-gnu-emacs@gnu.org; Mon, 16 Dec 2024 12:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 16 Dec 2024 17:22: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.173436970422649 (code B ref 74902); Mon, 16 Dec 2024 17:22:02 +0000 Original-Received: (at 74902) by debbugs.gnu.org; 16 Dec 2024 17:21:44 +0000 Original-Received: from localhost ([127.0.0.1]:55817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEmt-0005tF-RW for submit@debbugs.gnu.org; Mon, 16 Dec 2024 12:21:44 -0500 Original-Received: from mail-wm1-f50.google.com ([209.85.128.50]:58495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tNEms-0005t0-7U for 74902@debbugs.gnu.org; Mon, 16 Dec 2024 12:21:42 -0500 Original-Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-43634b570c1so19116765e9.0 for <74902@debbugs.gnu.org>; Mon, 16 Dec 2024 09:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734369636; x=1734974436; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=+tyZ8ug2iapkPaazXtqnArLHhj+Nu02rvRiMVwU4rt8=; b=H5qTcd0cHAWpjaaN4ge8Ooy+o6UGY3yYOkl0fiUsZhlEXtIQKzhAm5SbD5VFOv1FZM dIwdmM3YOoArAfLmUuBHWtjTx/urMcEcRbW4feG1BpSkUqObR3sqhaessIJhChdsYAQX 5nyO6nBkw4Nr0tRLMWlxExMXlaocSKmoO2Vm2kHmwwOAZxUhAJW0Bpstuwk9W/d1shf9 aw58JnTQ+tJt3AjnPRYhLSrDdS0w6mrekU/b+kZIrBNcgda2JGWvyfdW4VpnOsiJo8nI azz3yl+F8VujNWeDtKYHDVpxgeVTinue0HliPT0La7ADVPO1KgvH3z0C9Wm6Sosqf2Xl QQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734369636; x=1734974436; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+tyZ8ug2iapkPaazXtqnArLHhj+Nu02rvRiMVwU4rt8=; b=StD4pOu/Jmqzl7bUnUa9R+46S5++B8r8WWvDUNCEOlDOktX+/8Kjqv15hUr5qsfkkZ DhoKKCGn9MsjUKzfzKDmg/6d4m2WlYRERlONla/6m+CERKf04Hbpdy2qkT3Y2xX3QiA5 vuh82XX+yJG7vPSKplS+yI0Q4EA6+VpenTsKxI7uMg/1NFKGOwyqLFMaCJgLFRXyKctX R2X6ZB/f15NBwggROOX95r98PgTiVODv/U/fe6h9eYUVLDWlS8mJJzRwgqaNz9G/dUmO 6mzUtnJo3GgcxDEzxKxeG2UfMM8l7vgJuwXZ1CtAkYQooK/OEq8Ej9MQdWzZCJIVu+Ba qqnw== X-Forwarded-Encrypted: i=1; AJvYcCX+OPLHEoR5l7k2H9XXgKUZqTeqOVab3k+xJo8pNis7or96qehQpV2C60w7Akv+1o8GcUxD9A==@debbugs.gnu.org X-Gm-Message-State: AOJu0Yz6MrUun8GC9Yw7ikfjoVRNcVp4S+kKXX8L/QDwMtY0VsIWxfeR sv9KSqqVGibYy18x0I3mYdoNWF1meXs6Gm2fqS8qAsk1Hisv8vsnuaHaLQ== X-Gm-Gg: ASbGncuii8dYyutXTWvWwqWL/wUp4Kq7Tt3EavKuKvaQvMH3ufD0D55ODpb5bcZUXwO qROqt0Z08GG69/VkoJHzdyRYbgGNUwoVHbF3U2TSu1aU6KRA20bJ33Tkh8lbHQCp5liTW9s59ow hPDgQLEUItpvm5znCP639CR4E0NxjS4IJSoyNZI5r0WamnWhhNQ1PpkQEYW5ZiU4MXWlpVSWPFj lgx65e3VYfKEDCBKngotLXTkAgllgmoYBz16Q/zvuU= X-Google-Smtp-Source: AGHT+IEXr5gwi2F2u8CbXCrJIqKb3TRGM4J1Y2+wLPmimGKcpDimLPyy4wmTkvx4lVTQwtcZY9tJNw== X-Received: by 2002:a05:600c:cc9:b0:434:fec5:4ef5 with SMTP id 5b1f17b1804b1-4362aa43bcbmr133251085e9.14.1734369635731; Mon, 16 Dec 2024 09:20:35 -0800 (PST) Original-Received: from rltb ([2a01:e0a:3f3:fb51:a104:d8c:5af4:8136]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436362c6ae8sm90200905e9.41.2024.12.16.09.20.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 09:20:35 -0800 (PST) In-Reply-To: <87v7vjk3nl.fsf@stebalien.com> (Steven Allen via's message of "Mon, 16 Dec 2024 08:12:46 -0800") 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:297195 Archived-At: >>>>> 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 --