GNU bug report logs - #81935
31.1; 31.1; SIGABRT: error inside sweep_vectors/kill-buffer-hook bypasses condition-case, aborts process regardless of live handler

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Dominic Verity <dominic.verity@HIDDEN>; merged with #81905; dated Sun, 27 Sep 2026 17:17:09 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 81935 <at> debbugs.gnu.org:


Received: (at 81935) by debbugs.gnu.org; 28 Sep 2026 11:30:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Sep 28 07:30:20 2026
Received: from localhost ([127.0.0.1]:59487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xB9Yq-0000L0-DL
	for submit <at> debbugs.gnu.org; Mon, 28 Sep 2026 07:30:20 -0400
Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]:33247)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <spwhitton@HIDDEN>)
 id 1xB9Yn-0008Kt-N2
 for 81935 <at> debbugs.gnu.org; Mon, 28 Sep 2026 07:30:18 -0400
Received: from phl-compute-02.internal (phl-compute-02.internal [10.202.2.42])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 40E5114000E4;
 Mon, 28 Sep 2026 07:30:12 -0400 (EDT)
Received: from phl-frontend-04 ([10.202.2.163])
 by phl-compute-02.internal (MEProxy); Mon, 28 Sep 2026 07:30:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name;
 h=cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm3; t=1790595012; x=1790681412; bh=9YmP4H4cfW
 xNh4WZE3/uNdEcWdrB+Dp5xQVdQs0yZHk=; b=r4vckNZwyoGHyH2q9PlqVdjScW
 1jSHgoU/5kyAOvh2k61QZUdNGh4cOsRZxDRUfuR5HpYF7ycol/Qm8PdsmkCZ4Pgp
 r/1EwSmNnIB4W9/0+z7bMqE3q+WcY0SQP0GeawgZL0OrYTLte4sXAYo095eNuE8R
 i6Aa2G8rCN5ycCs1+/klI3ID038t/PzeUrcXa6KHuJvqwZdLbqvQv/gL/Uzc4MhQ
 gail3y4VdZkQkYGbsCunlS4XFgG5xmE2Kd8frgb1AZNn5++PLX+sIvIp78Nqno7K
 jjNeVI5jvtL7mjp9uAMyp79qMfU0PQQWO5hwjvtV8nTty2TI4iq3z+gJq1xg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
 1790595012; x=1790681412; bh=9YmP4H4cfWxNh4WZE3/uNdEcWdrB+Dp5xQV
 dQs0yZHk=; b=ef/MPRcohhPJ0Z6Z5AIyX7Muu5k6DPMzOeBOyXGDY5n2pygltzz
 DEaX2igpbS+Y2d/XnW0r3oDfzO6M6UFmnMHWeTb5CV5L8gVQJn8sq/dz4n3bnfct
 VXWmzaWE1rIL610hCj9l+wi0sq1Su9sCJqCIs+r+2PVvkxGDmaa+waDEr3ladPuB
 jGP6kbjrwEcEcuH71PsnYimi6Euu/4PoxdZ/1LdQBYG05/xXi+4xzYeh7tcKewWU
 +Tr0JfuvVnl4o6aakI8nv3P3/aNG38VW/ahCgBmKLAHfBQAoULp6yNXGA6Br0a/e
 z0AC1AgbpzBKlWWxdC3+yyDWjhzMYhu/ztw==
X-ME-Sender: <xms:w0-6aodU4q6kLGbqTqZJHsnY8jxokXLVHtwmDOHy0daqv5Z-xWixrA>
 <xme:w0-6aoKQnfStWp_9IkXrSgGVUgedT1xaa8EdMmWyVZR3cYmLaSBvTcdOtKdQcMIOL
 rfM4i_QSi41IReFL58vMFhD6_Fxgw3F0FxvjQ-9kVgiVi7tjK3Vg5w>
X-ME-Received: <xmr:w0-6ahHRiZQaLn5ueL9RmmVI9yLpIpaNvELxKuUPWvkC5gbuGW5fYY6ixr6GJUoXzf3Y8upz-6pi0SF8vaVo9soFQAMYXnPRTQ>
X-ME-Proxy-Cause: dmFkZTFbQqXaeHk3779qyIdFk549e74YaOPzHIsURQjP0qHlOsmkrwBlfEddf9LIfuhwgK
 It020CDUJxuYly/Kc95zl9yJFHdmWrP5uI4tE166xb/sqav7lY3tNH5m5C/6crikUkp9au
 KECscU+s2qFQs2MIBIJyiiI+9k5eN9BjYwqtki1aLLUOxs6sGyApWip2ilVcHbWpbPlqXh
 vCtjfzvHG0OP1XV2JLu7Ebu1kaIwu9TNaQd6lc4PScXh/aairAj8qMxyY7cTOxtgukqk8o
 BR3G0fp4RqIrNjAz+oIKvnhTX3aGm1qQfTnS8Bmvte9lSa8RU1F4qqMGYUsavQtBwJFvd0
 j5wKe0HhH0/IeGO2Rx1PQKUvy3ZN7By97XPTqorVv5glWQsUSD3sXL+hzHdAXkel81+HGB
 Nv1tC4FiNiQrlNBRIuyra7XvQZ9/DkerOYD+U+nPxf3MHwMUKneOhUQ2bAxLJ88t3qXvcl
 SIyl4nFmL/xAkupwiP5pJf8W/V7i1Z+pDF0CqLJkDOYuMZCaf/xdixUCXeEd6Z5jv0UpB3
 2sEtzj8WhE4s7RzK3+TusFQHIapA9wjtUsSl62518yC1alpwsvuxDfq23Sxv6dToXwCIjl
 0Mn7gQ+avhhmlrZzgdmRlJTAwYMkO/NcbcrObZGQS3M0DbV8H73IzxtY6sfA
X-ME-Proxy: <xmx:w0-6aqo1xyfKdATcBPiaG3deWutTRtLJPY3Mzl-MAEyOfNcB1SzZJA>
 <xmx:w0-6aiRIVap0LTjQfZUem1Wy96WA8bxNoyJadX6CrRrLYAXC7fRFow>
 <xmx:w0-6avMGIpCoLpNdr2nCr8y30wrV6ge6YQ-sMTTX6uwVjFBBNJhhTQ>
 <xmx:w0-6atNPPUdTHpOR8CyjYihXFcHVH5Xc5NnxHbbkw9Se26QASDlHoQ>
 <xmx:xE-6aoqHClK9_aZ5m4ayBQ1brx-LnHv31bhEKYh_V6bGcBtiVuVnZIsn>
Feedback-ID: i62564b17:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon,
 28 Sep 2026 07:30:11 -0400 (EDT)
Received: by athena.silentflame.com (Postfix, from userid 1000)
 id A8C33282BA5; Mon, 28 Sep 2026 12:30:10 +0100 (BST)
From: Sean Whitton <spwhitton@HIDDEN>
To: Dominic Verity <dominic.verity@HIDDEN>, 81935 <at> debbugs.gnu.org
Subject: Re: bug#81935: 31.1; 31.1; SIGABRT: error inside
 sweep_vectors/kill-buffer-hook bypasses condition-case, aborts process
 regardless of live handler
In-Reply-To: <D4C20E70-93A3-4FF2-B15C-51BDD4862677@HIDDEN>
References: <D4C20E70-93A3-4FF2-B15C-51BDD4862677@HIDDEN>
Date: Mon, 28 Sep 2026 12:30:10 +0100
Message-ID: <87ld8l7gvx.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 81935
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dominic Verity [27/Sep 10:52am GMT] wrote:
> (Bug traced with the assistance of Claude.ai Sonnet 5 Medium)

If you'd like to rewrite the bug report in your own words, it's more
likely someone will try to address it.

-- 
Sean Whitton




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#81935; Package emacs. Full text available.
Merged 81905 81935. Request was from Eli Zaretskii <eliz@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 81935 <at> debbugs.gnu.org:


Received: (at 81935) by debbugs.gnu.org; 27 Sep 2026 17:28:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 27 13:28:52 2026
Received: from localhost ([127.0.0.1]:52824 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xAsgE-0005r5-Hu
	for submit <at> debbugs.gnu.org; Sun, 27 Sep 2026 13:28:52 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:34966)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>)
 id 1xAsgB-0005qT-MK; Sun, 27 Sep 2026 13:28:49 -0400
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 <eliz@HIDDEN>)
 id 1xAsg4-0003kK-UV; Sun, 27 Sep 2026 13:28:40 -0400
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=v/MvcYwy4wmxQHUqd+Fy27GbkdgZ61nJFhOy35zA7DI=; b=cSUHHksOZB9h
 Xd01imuCeRMh8CIGfSE1/hqscMExvg2fq+eDDu3k3Rr/35BnlLvpebcl3GAVQpqEMZst41BqllCfm
 Urx3PlqcI364N0GT17DubR9Ddu/GQyjRy7KaEjsY6Cr9qXeFEMi8w5jAREWAb4Mf87cjfmSV6Ri/P
 PRokEph4yIiX3g2bmyfRkWxG1jaTXjhxcNWa/GL00hz7PAz/a5MVr04DS5ZTc2sV7ZSy2cv0CspOA
 CAojhOw0rb8T6zcN6DsvaMOq9yPkurR9iKgYpPgF83Pg0H05LM9RnW4IxVvrUYsVNpNo56bXqQ6vf
 7H6sL9HaVNT64siCuhr9SA==;
Date: Sun, 27 Sep 2026 20:28:38 +0300
Message-Id: <86ik3q4n95.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Dominic Verity <dominic.verity@HIDDEN>, Yuan Fu <casouri@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <D4C20E70-93A3-4FF2-B15C-51BDD4862677@HIDDEN> (message from
 Dominic Verity on Sun, 27 Sep 2026 10:52:45 +0000)
Subject: Re: bug#81935: 31.1; 31.1;
 SIGABRT: error inside sweep_vectors/kill-buffer-hook bypasses
 condition-case, aborts process regardless of live handler
References: <D4C20E70-93A3-4FF2-B15C-51BDD4862677@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 81935
Cc: 81935 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

merge 81935 81905
thanks

> From: Dominic Verity <dominic.verity@HIDDEN>
> Date: Sun, 27 Sep 2026 10:52:45 +0000
> 
> (Bug traced with the assistance of Claude.ai Sonnet 5 Medium)
> 
> Environment:
> - GNU Emacs 31.1 (9.0), ARM-64, native compilation, Homebrew emacs-plus@31 (--with-xwidgets --with-imagemagick --with-native-comp)
> - macOS 26.6.2 (25G83), Mac15,10 (Apple Silicon)
> - Reproduces after a full eln-cache wipe and rebuild, ruling out stale/corrupt native-comp cache as the cause.
> 
> Summary:
> 
> When GC's sweep phase reclaims a tree-sitter parser via treesit_delete_parser, it calls Fkill_buffer on the parser's associated buffer, which runs the buffer's kill-buffer-hook. If any hook function signals a Lisp error in this context, Emacs aborts the entire process (SIGABRT) even when a live condition-case handler is present on the Lisp stack wrapping that exact call -- confirmed via lldb, where the frame internal_lisp_condition_case is present on the stack at the moment of the fatal abort. This means the error is not merely uncaught by application code; Emacs's own signal-handling logic (signal_or_quit) refuses the normal non-local exit and forces a hard abort instead, apparently because unwinding out of GC's sweep loop midway is considered unsafe for heap consistency.
> 
> The specific hook function whose native-compiled code triggers this (tramp-flush-file-function) may itself have a real bug (its error path bottoms out in Fmake_closure's "cold"/error branch, suggesting a closure-materialization failure at the C level rather than an ordinary Lisp error), but that is secondary to the structural issue: any error from any kill-buffer-hook function reached via this GC-sweep code path is unconditionally fatal, unrecoverable even by condition-case.

AFAIU, this is identical to the known bug#81905, so I'm merging them.

> Minimal reproduction (emacs -Q --batch -l repro.el):
> 
> ; repro.el  -*- lexical-binding: t; -*-
> (require 'treesit)
> (require 'tramp)
> 
> (advice-add 'tramp-flush-file-function :around
>             (lambda (orig &rest args)
>               (condition-case err
>                   (apply orig args)
>                 (error
>                  (princ (format "CAUGHT: %S\n" err) #'external-debugging-output)
>                  (signal (car err) (cdr err))))))
> 
> (treesit-parse-string "foo: bar" 'yaml)
> (garbage-collect)
> 
> This reliably aborts Emacs with "Fatal error 6: Aborted", and critically, the "CAUGHT:" message never prints -- confirming the condition-case handler wrapping the call is present but never reached before the abort. Verified reproducible from a completely stock emacs -Q environment with no user configuration, and after a full eln-cache rebuild.
> 
> Removing (require 'tramp) from the reproduction prevents the crash entirely, since without Tramp loaded, kill-buffer-hook only contains uniquify-kill-buffer-function and vc-kill-buffer-hook, neither of which triggers the failure. This confirms tramp-flush-file-function's native-compiled code is genuinely the specific trigger here. In practice this makes little difference to real-world impact, since Tramp is autoloaded by many common operations (find-file, Dired, Magit, project.el, etc.) well before any tree-sitter-triggered GC would occur -- so almost any real-world session with tree-sitter modes in active use will have tramp-flush-file-function on kill-buffer-hook long before this crash path is hit.
> 
> Backtrace (via lldb, `bt` at the SIGABRT):
> 
> kill-buffer-hook members: (tramp-flush-file-function tramp-delete-temp-file-function uniquify-kill-buffer-function vc-kill-buffer-hook)
> Process 45551 stopped
> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
>     frame #0: 0x000000018b6a45e8 libsystem_kernel.dylib`__pthread_kill + 8
> libsystem_kernel.dylib`__pthread_kill:
> ->  0x18b6a45e8 <+8>:  b.lo   0x18b6a4608    ; <+40>
>     0x18b6a45ec <+12>: pacibsp
>     0x18b6a45f0 <+16>: stp    x29, x30, [sp, #-0x10]!
>     0x18b6a45f4 <+20>: mov    x29, sp
> Target 0: (Emacs) stopped.
> (lldb) bt
> * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
>   * frame #0: 0x000000018b6a45e8 libsystem_kernel.dylib`__pthread_kill + 8
>     frame #1: 0x000000018b6df8d8 libsystem_pthread.dylib`pthread_kill + 296
>     frame #2: 0x000000018b5ae388 libsystem_c.dylib`raise + 32
>     frame #3: 0x0000000100209334 Emacs`terminate_due_to_signal + 228
>     frame #4: 0x0000000100209ea0 Emacs`emacs_abort + 20
>     frame #5: 0x00000001001d4a14 Emacs`ns_term_shutdown + 132
>     frame #6: 0x00000001000c3aa4 Emacs`shut_down_emacs + 360
>     frame #7: 0x00000001002092f8 Emacs`terminate_due_to_signal + 168
>     frame #8: 0x0000000100209ea0 Emacs`emacs_abort + 20
>     frame #9: 0x000000010013f8c4 Emacs`signal_or_quit + 1552
>     frame #10: 0x000000010020b5c4 Emacs`Fsignal + 40
>     frame #11: 0x000000010020a358 Emacs`xsignal + 12
>     frame #12: 0x000000010020b410 Emacs`xsignal1 + 28
>     frame #13: 0x000000010020b624 Emacs`verror + 24
>     frame #14: 0x000000010020b3f4 Emacs`error + 28
>     frame #15: 0x000000010020a9b0 Emacs`Fmake_closure.cold.1 + 20
>     frame #16: 0x000000010011d2c4 Emacs`Fmake_closure + 236
>     frame #17: 0x000000010491a1f8 tramp-cache-8941dd69-1944140b.eln`F7472616d702d666c7573682d66696c652d66756e6374696f6e_tramp_flush_file_function_0 + 80
>     frame #18: 0x000000010013ccd8 Emacs`Ffuncall + 328
>     frame #19: 0x000000010013c244 Emacs`eval_sub + 1452
>     frame #20: 0x000000010013eb40 Emacs`internal_lisp_condition_case + 712
>     frame #21: 0x000000010013c150 Emacs`eval_sub + 1208
>     frame #22: 0x0000000100141404 Emacs`funcall_lambda + 900
>     frame #23: 0x000000010013ccd8 Emacs`Ffuncall + 328
>     frame #24: 0x000000010017d668 Emacs`exec_byte_code + 1856
>     frame #25: 0x000000010013ccd8 Emacs`Ffuncall + 328
>     frame #26: 0x0000000100140830 Emacs`funcall_nil + 12
>     frame #27: 0x0000000100140758 Emacs`run_hook_with_args + 244
>     frame #28: 0x000000010014064c Emacs`run_hook + 36
>     frame #29: 0x00000001000e86c0 Emacs`Fkill_buffer + 512
>     frame #30: 0x00000001001b4424 Emacs`treesit_delete_parser + 36
>     frame #31: 0x0000000100121f3c Emacs`sweep_vectors + 280
>     frame #32: 0x000000010011e894 Emacs`garbage_collect + 1772
>     frame #33: 0x000000010011ed44 Emacs`Fgarbage_collect + 80
>     frame #34: 0x000000010013c170 Emacs`eval_sub + 1240
>     frame #35: 0x000000010016b03c Emacs`readevalloop_eager_expand_eval + 164
>     frame #36: 0x0000000100164d7c Emacs`readevalloop + 1624
>     frame #37: 0x000000010016542c Emacs`Feval_buffer + 368
>     frame #38: 0x000000010017d668 Emacs`exec_byte_code + 1856
>     frame #39: 0x000000010013ccd8 Emacs`Ffuncall + 328
>     frame #40: 0x0000000100163140 Emacs`Fload + 1824
>     frame #41: 0x000000010017d668 Emacs`exec_byte_code + 1856
>     frame #42: 0x00000001001401c8 Emacs`apply_lambda + 276
>     frame #43: 0x000000010013c45c Emacs`eval_sub + 1988
>     frame #44: 0x000000010014001c Emacs`Feval + 84
>     frame #45: 0x00000001000d36a4 Emacs`top_level_2 + 68
>     frame #46: 0x000000010013ee78 Emacs`internal_condition_case + 92
>     frame #47: 0x00000001000d3630 Emacs`top_level_1 + 48
>     frame #48: 0x000000010013e77c Emacs`internal_catch + 88
>     frame #49: 0x0000000100209730 Emacs`command_loop.cold.1 + 68
>     frame #50: 0x00000001000c65c8 Emacs`command_loop + 156
>     frame #51: 0x00000001000c6484 Emacs`recursive_edit_1 + 184
>     frame #52: 0x00000001000c66fc Emacs`Frecursive_edit + 284
>     frame #53: 0x00000001000c5654 Emacs`main + 6996
>     frame #54: 0x000000018b3144e4 dyld`start + 6992
>     
> Expected behavior: At minimum, a condition-case handler that is live on the Lisp stack around the erroring call should be honored, rather than the process aborting unconditionally regardless of handlers present. More broadly, treesit_delete_parser's use of Fkill_buffer (full Lisp hook evaluation with arbitrary side effects) from inside GC's sweep phase seems like the root design issue -- reclaiming these internal parser-associated buffers via a mechanism that can run arbitrary user hooks, from a context where errors are unconditionally fatal, seems unsafe regardless of which specific hook function is involved.
> 
> Additional notes:
> 
> - Not specific to any major mode or third-party package -- this reproduces purely from core treesit.el's treesit-parse-string, which is called internally by tree-sitter-based packages (in my case, yaml-pro-ts-mode's eldoc support) as part of ordinary editing.
> - undo-tree was involved in my original discovery of this (its explicit garbage-collect call made the timing reliable), but is not required -- the crash reproduces from any GC event, including ones triggered automatically by ordinary allocation during redisplay.
> - I could not determine why tramp-flush-file-function's native code hits Fmake_closure's error path for this particular internal buffer (buffer-file-name nil, default-directory a plain local path) -- happy to investigate further if that's useful, but the fatal-despite-condition-case behavior is reproducible and concerning independent of that specific function's correctness.
> - Related but distinct: bug#67977 (treesit + narrowing + GC).
> 
> 
> In GNU Emacs 31.1 (build 1, aarch64-apple-darwin25.6.0, NS
> appkit-2685.70 Version 26.6.2 (Build 25G83)) of 2026-09-27 built on
> Germain.local
> Windowing system distributor 'Apple', version 10.3.2685
> System Description:  macOS 26.6.2
> 
> Configured using:
> 'configure --disable-dependency-tracking --disable-silent-rules
> --enable-locallisppath=/opt/homebrew/share/emacs/site-lisp
> --infodir=/opt/homebrew/Cellar/emacs-plus@31/31.1/share/info/emacs
> --prefix=/opt/homebrew/Cellar/emacs-plus@31/31.1
> --with-native-compilation=aot --with-xml2 --with-gnutls
> --without-compress-install 'CFLAGS=-DFD_SETSIZE=10000
> -DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/sqlite/include
> -I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include'
> --without-dbus --with-imagemagick --with-modules --with-rsvg
> --with-webp --with-xwidgets --with-ns --disable-ns-self-contained
> 'LDFLAGS=-L/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/lib/gcc/16
> -Wl,-rpath,/opt/homebrew/lib/gcc/16''
> 
> Configured features:
> ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG LCMS2 LIBXML2 MODULES
> NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
> TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB
> 
> Important settings:
>   value of $LC_MONETARY: en_AU.UTF-8
>   value of $LANG: en_GB.UTF-8
>   locale-coding-system: utf-8-unix
> 
> Major mode: Lisp Interaction
> 
> Minor modes in effect:
>   tooltip-mode: t
>   global-eldoc-mode: t
>   eldoc-mode: t
>   show-paren-mode: t
>   electric-indent-mode: t
>   mouse-wheel-mode: t
>   tool-bar-mode: t
>   menu-bar-mode: t
>   file-name-shadow-mode: t
>   global-font-lock-mode: t
>   font-lock-mode: t
>   blink-cursor-mode: t
>   minibuffer-nonselected-mode: t
>   minibuffer-regexp-mode: t
>   line-number-mode: t
>   indent-tabs-mode: t
>   transient-mark-mode: t
>   auto-composition-mode: t
>   auto-encryption-mode: t
>   auto-compression-mode: t
> 
> Load-path shadows:
> None found.
> 
> Features:
> (shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
> dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
> rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies
> mm-encode mailabbrev gmm-utils mailheader sendmail mail-parse rfc2231
> rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp-run
> bytecomp byte-compile comp-common rx time-date subr-x cl-loaddefs cl-lib
> rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
> vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
> ucs-normalize mule-util term/common-win tool-bar dnd fontset image
> regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
> prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
> timer select scroll-bar mouse jit-lock font-lock syntax font-core
> term/tty-colors frame minibuffer nadvice seq simple cl-generic
> indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
> tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
> romanian slovak czech european ethiopic indian cyrillic chinese
> composite emoji-zwj charscript charprop case-table epa-hook
> jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
> theme-loaddefs faces cus-face macroexp files window text-properties
> overlay sha1 md5 base64 format env code-pages mule custom widget keymap
> hashtable-print-readable backquote threads xwidget-internal kqueue cocoa
> ns lcms2 multi-tty make-network-process tty-child-frames native-compile
> emacs)
> 
> Memory information:
> ((conses 16 56652 12009) (symbols 48 6150 0) (strings 32 14973 2418)
> (string-bytes 1 451366) (vectors 16 9634)
> (vector-slots 8 133745 9121) (floats 8 23 6) (intervals 56 272 0)
> (buffers 1064 10))
> 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#81935; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 27 Sep 2026 17:16:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 27 13:16:29 2026
Received: from localhost ([127.0.0.1]:51030 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1xAsUD-0004gX-8i
	for submit <at> debbugs.gnu.org; Sun, 27 Sep 2026 13:16:29 -0400
Received: from lists1p.gnu.org ([2001:470:142::17]:55676)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <dominic.verity@HIDDEN>)
 id 1xAmXO-0006TM-RY
 for submit <at> debbugs.gnu.org; Sun, 27 Sep 2026 06:55:21 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dominic.verity@HIDDEN>)
 id 1xAmXI-0003MZ-Jg
 for bug-gnu-emacs@HIDDEN; Sun, 27 Sep 2026 06:55:12 -0400
Received: from au-smtp-delivery-110.mimecast.com ([103.96.21.110])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dominic.verity@HIDDEN>)
 id 1xAmXE-0001os-5i
 for bug-gnu-emacs@HIDDEN; Sun, 27 Sep 2026 06:55:12 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mq.edu.au;
 s=mimecast20180308; t=1790506501;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=7QIToYceSH4kj8kI72/y7Yy4VognkkmX8+vOKiwBcgE=;
 b=ordDR/0ub5bgmLAc/fGVWoiS7TUPOZiN1qR5Z3TAdcnjQlGpnGnEfU2506ClLImnjqHj44
 rmtF39Y1MyoCQysHyQiGbz2oNOqNUZKrKoMFPfWMc0COIiPNmlXNXdu6ukG06UI8ipVQSF
 iFWMR6Cj8w/IfgcVXdfkp0PP/J7fBFQ=
Received: from SY2PR01CU004.outbound.protection.outlook.com
 (mail-australiaeastazon11021124.outbound.protection.outlook.com
 [40.107.39.124]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id
 au-mta-46-uf1KcGtTPI2x15SHQmgdCA-1; Sun, 27 Sep 2026 20:52:49 +1000
X-MC-Unique: uf1KcGtTPI2x15SHQmgdCA-1
X-Mimecast-MFC-AGG-ID: uf1KcGtTPI2x15SHQmgdCA_1790506369
Received: from SY0PR01MB10935.ausprd01.prod.outlook.com (2603:10c6:10:339::15)
 by SY7PR01MB8511.ausprd01.prod.outlook.com (2603:10c6:10:1f2::8) with
 Microsoft SMTP Server (version=TLS1_2,
 cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.451.18; Sun, 27 Sep
 2026 10:52:46 +0000
Received: from SY0PR01MB10935.ausprd01.prod.outlook.com
 ([fe80::1342:b299:71f5:d944]) by SY0PR01MB10935.ausprd01.prod.outlook.com
 ([fe80::1342:b299:71f5:d944%4]) with mapi id 15.21.0451.014; Sun, 27 Sep 2026
 10:52:46 +0000
From: Dominic Verity <dominic.verity@HIDDEN>
To: "bug-gnu-emacs@HIDDEN" <bug-gnu-emacs@HIDDEN>
Subject: 31.1; 31.1; SIGABRT: error inside sweep_vectors/kill-buffer-hook
 bypasses condition-case, aborts process regardless of live handler
Thread-Topic: 31.1; 31.1; SIGABRT: error inside sweep_vectors/kill-buffer-hook
 bypasses condition-case,
 aborts process regardless of live handler
Thread-Index: AQHdTm5U4k0qAvy3X0i4Yz0nopRM4w==
Date: Sun, 27 Sep 2026 10:52:45 +0000
Message-ID: <D4C20E70-93A3-4FF2-B15C-51BDD4862677@HIDDEN>
Accept-Language: en-GB, en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-mailer: Apple Mail (2.3864.700.51.1.1)
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: SY0PR01MB10935:EE_|SY7PR01MB8511:EE_
x-ms-office365-filtering-correlation-id: 7d1c6253-4b89-46df-3af3-08df1c8576d0
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
 ARA:13230040|1800799024|376014|19092799006|366016|786006|23010399003|38070700021|260925022911599003|260925021311599003|6133799003|3023799007|10067099003|11063799006|56012099006|18002099003
x-microsoft-antispam-message-info: z9LlyxzikT8QF8fF7Mdhs2LpjJWV5GIxvAuyAdW8kDjymdN8eiypviTj62+pYUsU376HEUl0xFczW65mEHBPiap4d85+mqaQ2ZnkPWn1/prpP/ZCNr3hmkuIRnfblEn+dVthJ2M5MkuALsvhqq6jhFrZRk/WVSfLP67YrtnyRYtAqhv081BXskQdYJPpnukHxeT4/KmmFZxxc2bSCwqwnOmekkwjDZO/gvk0Mu3fl1t60GtUmPqWoz1Yx38qazwQEDc95nK2Qo3fYdatHaoFlQRakRaev6J46+5xuCA6E634b9iTlKLVk/XEQCh4oMznJbsjd5/ySLFslQCA1WRXzk6KXhKimTmUrQmHuE2Ravsa8LWwYmie/RbT78IwsDwOrYi5znqlDCRaxV0bMcUOsaU1Im6oitVesDHAev2FcM7tZcArsYC3YXyAxUhn/D4zwktJk5K5lt5pNSOks17sgZHblrUkk3Vn6FbXFBLe7GWM19zEBgoiKLczd0oIbuNPCgMvG1YfsWagkyQaDcwq6WUulWFpSbn2AIKuWsJf17Xy3QCwf7bDZa86slNZdc5HW9wunS4RBFa4Was5lEI8rJFXfw8D1naYBvUj5uqvF4MxApRbGJMgYZTSl4zq2Ljc7oYjgVLWknuvkP5XZ1Z3g+Pwbg0ZwDhohOQZBKhBerFUHa/UZoBFrhCyoVNKvKPyMTZnILZMrcC/TZlqeqHwrmVkU7DOCqLond4ngGT3S+M=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
 IPV:NLI; SFV:NSPM; H:SY0PR01MB10935.ausprd01.prod.outlook.com; PTR:; CAT:NONE;
 SFS:(13230040)(1800799024)(376014)(19092799006)(366016)(786006)(23010399003)(38070700021)(260925022911599003)(260925021311599003)(6133799003)(3023799007)(10067099003)(11063799006)(56012099006)(18002099003);
 DIR:OUT; SFP:1102
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yjV1ZYgtQWGdBVXUeon8Aedo/ecCporWjDxutWzGogR7QCOy17oAz7FZe1HM?=
 =?us-ascii?Q?ktbhS65lXwtLek9NHJoWvrytxVSY5Av1vPH39Rp53Ma+usCtiwUIIf9ovJLx?=
 =?us-ascii?Q?xf+4QIHSDAGsZH44ZXaD9EqgAziWB+NTWDuxa0vjDhu2wtnxoTPG01DLZmF8?=
 =?us-ascii?Q?0z30qGRFxtUAmIftjELHV55FBtotI0hCaQU38sz6+nL8Lu2UBPB7vRN3Te72?=
 =?us-ascii?Q?/4SN0d8GgZwZX08x4PZ1Fyqk0tavvFcHXzff2FiANYnsQM+MxH5siDS+hNVd?=
 =?us-ascii?Q?SNgjzDYSkUXnMzDA7T+jq7POdqmNJWL7T4y4SygEcG8dxWXj3nwRlwTdZ05B?=
 =?us-ascii?Q?bGKx3kMfhFCFPK4r3QnYCavodPUqU6k60YspR0GdJ2KF38kvNW+XlmoM1oz8?=
 =?us-ascii?Q?O3oezP/gBwxcI/f2RCAwoZchjtjJMpTu02rwqZm8uUndMSDY96JJ3FqBK84s?=
 =?us-ascii?Q?oA/Il0nYpcCopk1sLsKl6sQWS0ZwON9eZPrMEq4+7tIF89XUiCIgOkQfr6OT?=
 =?us-ascii?Q?6OcDyvoAwk1tFk6NLyahurIXl+Gm2AMOIPeVePgtclpxNWX59keCKW3XWIQh?=
 =?us-ascii?Q?T7iZ6cBZIAB4zenZAMniIVzRwjVKEcYz5Xac6hTF4po/c2gzho80exrHb9nu?=
 =?us-ascii?Q?65yRBlXmcMhsKpNq9KozM/+6cqXmSCkn0XomjzWBfPhzmjhx9ov2ILdAluHA?=
 =?us-ascii?Q?LWdgbsx3BarSglFBpsjTyxPsGN6pmLS2XG+FbpA0A716Oyj0SQ2CwSN3d5rR?=
 =?us-ascii?Q?PFhDKmartCjf2PW4MSR3kEWrFJ+JB4Owt3uZJeZbCBtz9I2uoh1QJMhDHGC6?=
 =?us-ascii?Q?FJHFeNUbh6B5/fYHDsyKrBIClIevjDQlhNGgpQnSpBRBFW1PSs7TMb2kewPu?=
 =?us-ascii?Q?fZiXtSlHR/PsIWw3xX1mAh+X1D415pgvcewjD14tcOa105RDTCC7nAOBNcIR?=
 =?us-ascii?Q?Y/iWKcVGFrAAsBpN8ITsGcp0XWW2x+fUvPF7hzeobJdkRamnagYVaih3cFp5?=
 =?us-ascii?Q?Yg/XHl+HCmqMEiPzWgkCAUCdXWJIrbExgLcY2hQNuPeYbyEkzCNhNtbS4FCk?=
 =?us-ascii?Q?1+l6SEmAu/+C7dckHgutE3dCBzClp1rFr1nrhMa+FHqn5tGMbzuxTj9Lk6R4?=
 =?us-ascii?Q?j5Dkv9jPhTGaUoCdUiBfKpdd2yWbHc1Xab+tO+ntyS0O3B0vj7J/LWQ5EEWd?=
 =?us-ascii?Q?DwLud80iruIfDgSUOjMy+9dCkwEntJ17wSPFaAVFnIVhFgqUelbuNnvir1YZ?=
 =?us-ascii?Q?URdHzGswtEG3jf4HZwLtYBMJpKRe4BMj0WhhpRvlTZeG1mVY2TztfFuagaAv?=
 =?us-ascii?Q?8dZNBkpdnmh13YU3JfvgMjzAfkAF4AdwsT7dSkev5V91RM0+87SWHzGjPBw8?=
 =?us-ascii?Q?lJgkrtDXcOBZnwa50PVxFTdQp5GIRM2skkV8sOILdgtg5WMk6AhaN/FGJmWH?=
 =?us-ascii?Q?scv3lCKkoiUIQiMLn/3h1M/h/U0LvvgoxElju20PhegSMJJEfogswTcj3X5a?=
 =?us-ascii?Q?eOOPmxQLRt9NB2oTx3gVE2tOXfpWkukEaVyuendqfYWxqptUzwCyTQ0Hboce?=
 =?us-ascii?Q?/dwlssZCnaeWCHYZNFO6lnUWbOmq71MLIrkfHs7h4j5np/WzEmjma1O6Sqir?=
 =?us-ascii?Q?ylNxbvaAo6IEj9A5mvasOWPhcuToF1qKLC0l5HULwp3iWWVSzwwfWLhds1Lo?=
 =?us-ascii?Q?XoyJjOk1ShH5wFBwhMIMen0yAWagg0MoBOlMgbGOVMyIFhVoeZzrH3fNo7Ug?=
 =?us-ascii?Q?EXFk22qe5RNYiKksZ3tF26PrbSGPkSk=3D?=
MIME-Version: 1.0
X-Exchange-RoutingPolicyChecked: KxAk96c7i4nDcdPMtKJhaWFLZvQie5gkfS/U9r6vqa/dOJmqp4zhBPyqGpcDaOIgtzRNawbTEZErcWkYWKY2s5l3HSGelL22vV6AkQWLUZKtywLYyjta1xTh2GldBZI5d/w7raTJdOG3WoK/SCLSDwiwoi4KtON+UKHBpJFoKxuP+uY72EM4ZPNVDpTSEJWU/Kt7IXKDWRXcaD4jqwRiU+yZsTqN2PBkKMuVQPVwRbb2EzdzDyL0ziIpQE/1+ByxRa+zjpytVvhzRp9vatZPEzfspGgXhoiXCvdfuW2Xtm6Ht9+BLWKDHds4PRdYh1Yvky6HdSmY1uqKng+63zidcA==
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: cahCVeF2WYG+PkKFSh+pOBNe0iyuaYQIAFQlxCa/KuU8kExSUII5AEPc1BU0M9MTBy7RkMWP38xnmsx0umdFjDZ8gYOjYoSaXUMrA/AEumICDEjAC4gPVTqnMvOYo2EghJfA8txGslQ+glYzDFv7VTz+k8Gw/Jle+arrNNtUrviPVjqOPGWID0jIFx0KqGOENe1myvBg6Es6c5eYiuOLnLzYD4OWVAjk+uVwC2Qd8U1b29DsaN3TbVmSXj6dOEk3HbNVEPLM0j8kArqnmb5RQIbp8g5h5WgMtj79EG5LfBQ/1ril4MR04o3hZxsMFytuoeqfDZHrZvpR7y+9LWpqv15coAQ7vxemrkdhAyvt07VyEliH+nXn7heaRtk7MUpDueKkjEZ2EWjH2gZlZYmdk6CHDOG1Y6Ferl/fzQGhnf2KQ+h9BKtUzqXv7pgIh8b9KUA8VGhwwsq0px/xKnOC+DNAKBAFFXCk3k5PUG+7a9vPlvVZK7rEeoc4eN44N3kB4RCGYDf9OVnpoNeAULWFRoZMMbQaeaqwWouPN919fXEHrhhSzEHmlTwcFoaku0IfhuaeJ4Jdp/P7PA0s25oNu8Cmvygz2yTxtmm0o3LsNWSC5g/S7+heDvKjF50HPLepxAB8Ss/rIKuAkohbfjeQwg==
X-OriginatorOrg: mq.edu.au
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: SY0PR01MB10935.ausprd01.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7d1c6253-4b89-46df-3af3-08df1c8576d0
X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2026 10:52:45.8972 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 82c514c1-a717-4087-be06-d40d2070ad52
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: QCm/QxGq/q1hw3OZ/H2m7cLqiqp/WQguurf0AsXISZjkXb8HYgOA5VQzwzAN+LmmQO7R55PnFeWBaYi34q6/8PK+vZbJlRDBwzxT8cjah+o=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SY7PR01MB8511
X-Mimecast-Spam-Score: 0
X-Mimecast-MFC-PROC-ID: YKZ-4wl2Ructe_9dhXd4KYZSlrdI8EInuOlP2gqyaKk_1790506369
X-Mimecast-Originator: mq.edu.au
Content-Language: en-US
Content-Type: text/plain; charset=WINDOWS-1252
Content-ID: <36F6CF43637C8F4FA315EC40B3D99BF6@HIDDEN>
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=103.96.21.110;
 envelope-from=dominic.verity@HIDDEN; helo=au-smtp-delivery-110.mimecast.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 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,
 RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Sun, 27 Sep 2026 13:16:24 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

(Bug traced with the assistance of Claude.ai Sonnet 5 Medium)

Environment:
- GNU Emacs 31.1 (9.0), ARM-64, native compilation, Homebrew emacs-plus@31 =
(--with-xwidgets --with-imagemagick --with-native-comp)
- macOS 26.6.2 (25G83), Mac15,10 (Apple Silicon)
- Reproduces after a full eln-cache wipe and rebuild, ruling out stale/corr=
upt native-comp cache as the cause.

Summary:

When GC's sweep phase reclaims a tree-sitter parser via treesit_delete_pars=
er, it calls Fkill_buffer on the parser's associated buffer, which runs the=
 buffer's kill-buffer-hook. If any hook function signals a Lisp error in th=
is context, Emacs aborts the entire process (SIGABRT) even when a live cond=
ition-case handler is present on the Lisp stack wrapping that exact call --=
 confirmed via lldb, where the frame internal_lisp_condition_case is presen=
t on the stack at the moment of the fatal abort. This means the error is no=
t merely uncaught by application code; Emacs's own signal-handling logic (s=
ignal_or_quit) refuses the normal non-local exit and forces a hard abort in=
stead, apparently because unwinding out of GC's sweep loop midway is consid=
ered unsafe for heap consistency.

The specific hook function whose native-compiled code triggers this (tramp-=
flush-file-function) may itself have a real bug (its error path bottoms out=
 in Fmake_closure's "cold"/error branch, suggesting a closure-materializati=
on failure at the C level rather than an ordinary Lisp error), but that is =
secondary to the structural issue: any error from any kill-buffer-hook func=
tion reached via this GC-sweep code path is unconditionally fatal, unrecove=
rable even by condition-case.

Minimal reproduction (emacs -Q --batch -l repro.el):

; repro.el  -*- lexical-binding: t; -*-
(require 'treesit)
(require 'tramp)

(advice-add 'tramp-flush-file-function :around
            (lambda (orig &rest args)
              (condition-case err
                  (apply orig args)
                (error
                 (princ (format "CAUGHT: %S\n" err) #'external-debugging-ou=
tput)
                 (signal (car err) (cdr err))))))

(treesit-parse-string "foo: bar" 'yaml)
(garbage-collect)

This reliably aborts Emacs with "Fatal error 6: Aborted", and critically, t=
he "CAUGHT:" message never prints -- confirming the condition-case handler =
wrapping the call is present but never reached before the abort. Verified r=
eproducible from a completely stock emacs -Q environment with no user confi=
guration, and after a full eln-cache rebuild.

Removing (require 'tramp) from the reproduction prevents the crash entirely=
, since without Tramp loaded, kill-buffer-hook only contains uniquify-kill-=
buffer-function and vc-kill-buffer-hook, neither of which triggers the fail=
ure. This confirms tramp-flush-file-function's native-compiled code is genu=
inely the specific trigger here. In practice this makes little difference t=
o real-world impact, since Tramp is autoloaded by many common operations (f=
ind-file, Dired, Magit, project.el, etc.) well before any tree-sitter-trigg=
ered GC would occur -- so almost any real-world session with tree-sitter mo=
des in active use will have tramp-flush-file-function on kill-buffer-hook l=
ong before this crash path is hit.

Backtrace (via lldb, `bt` at the SIGABRT):

kill-buffer-hook members: (tramp-flush-file-function tramp-delete-temp-file=
-function uniquify-kill-buffer-function vc-kill-buffer-hook)
Process 45551 stopped
* thread #1, queue =3D 'com.apple.main-thread', stop reason =3D signal SIGA=
BRT
    frame #0: 0x000000018b6a45e8 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x18b6a45e8 <+8>:  b.lo   0x18b6a4608    ; <+40>
    0x18b6a45ec <+12>: pacibsp
    0x18b6a45f0 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x18b6a45f4 <+20>: mov    x29, sp
Target 0: (Emacs) stopped.
(lldb) bt
* thread #1, queue =3D 'com.apple.main-thread', stop reason =3D signal SIGA=
BRT
  * frame #0: 0x000000018b6a45e8 libsystem_kernel.dylib`__pthread_kill + 8
    frame #1: 0x000000018b6df8d8 libsystem_pthread.dylib`pthread_kill + 296
    frame #2: 0x000000018b5ae388 libsystem_c.dylib`raise + 32
    frame #3: 0x0000000100209334 Emacs`terminate_due_to_signal + 228
    frame #4: 0x0000000100209ea0 Emacs`emacs_abort + 20
    frame #5: 0x00000001001d4a14 Emacs`ns_term_shutdown + 132
    frame #6: 0x00000001000c3aa4 Emacs`shut_down_emacs + 360
    frame #7: 0x00000001002092f8 Emacs`terminate_due_to_signal + 168
    frame #8: 0x0000000100209ea0 Emacs`emacs_abort + 20
    frame #9: 0x000000010013f8c4 Emacs`signal_or_quit + 1552
    frame #10: 0x000000010020b5c4 Emacs`Fsignal + 40
    frame #11: 0x000000010020a358 Emacs`xsignal + 12
    frame #12: 0x000000010020b410 Emacs`xsignal1 + 28
    frame #13: 0x000000010020b624 Emacs`verror + 24
    frame #14: 0x000000010020b3f4 Emacs`error + 28
    frame #15: 0x000000010020a9b0 Emacs`Fmake_closure.cold.1 + 20
    frame #16: 0x000000010011d2c4 Emacs`Fmake_closure + 236
    frame #17: 0x000000010491a1f8 tramp-cache-8941dd69-1944140b.eln`F747261=
6d702d666c7573682d66696c652d66756e6374696f6e_tramp_flush_file_function_0 + =
80
    frame #18: 0x000000010013ccd8 Emacs`Ffuncall + 328
    frame #19: 0x000000010013c244 Emacs`eval_sub + 1452
    frame #20: 0x000000010013eb40 Emacs`internal_lisp_condition_case + 712
    frame #21: 0x000000010013c150 Emacs`eval_sub + 1208
    frame #22: 0x0000000100141404 Emacs`funcall_lambda + 900
    frame #23: 0x000000010013ccd8 Emacs`Ffuncall + 328
    frame #24: 0x000000010017d668 Emacs`exec_byte_code + 1856
    frame #25: 0x000000010013ccd8 Emacs`Ffuncall + 328
    frame #26: 0x0000000100140830 Emacs`funcall_nil + 12
    frame #27: 0x0000000100140758 Emacs`run_hook_with_args + 244
    frame #28: 0x000000010014064c Emacs`run_hook + 36
    frame #29: 0x00000001000e86c0 Emacs`Fkill_buffer + 512
    frame #30: 0x00000001001b4424 Emacs`treesit_delete_parser + 36
    frame #31: 0x0000000100121f3c Emacs`sweep_vectors + 280
    frame #32: 0x000000010011e894 Emacs`garbage_collect + 1772
    frame #33: 0x000000010011ed44 Emacs`Fgarbage_collect + 80
    frame #34: 0x000000010013c170 Emacs`eval_sub + 1240
    frame #35: 0x000000010016b03c Emacs`readevalloop_eager_expand_eval + 16=
4
    frame #36: 0x0000000100164d7c Emacs`readevalloop + 1624
    frame #37: 0x000000010016542c Emacs`Feval_buffer + 368
    frame #38: 0x000000010017d668 Emacs`exec_byte_code + 1856
    frame #39: 0x000000010013ccd8 Emacs`Ffuncall + 328
    frame #40: 0x0000000100163140 Emacs`Fload + 1824
    frame #41: 0x000000010017d668 Emacs`exec_byte_code + 1856
    frame #42: 0x00000001001401c8 Emacs`apply_lambda + 276
    frame #43: 0x000000010013c45c Emacs`eval_sub + 1988
    frame #44: 0x000000010014001c Emacs`Feval + 84
    frame #45: 0x00000001000d36a4 Emacs`top_level_2 + 68
    frame #46: 0x000000010013ee78 Emacs`internal_condition_case + 92
    frame #47: 0x00000001000d3630 Emacs`top_level_1 + 48
    frame #48: 0x000000010013e77c Emacs`internal_catch + 88
    frame #49: 0x0000000100209730 Emacs`command_loop.cold.1 + 68
    frame #50: 0x00000001000c65c8 Emacs`command_loop + 156
    frame #51: 0x00000001000c6484 Emacs`recursive_edit_1 + 184
    frame #52: 0x00000001000c66fc Emacs`Frecursive_edit + 284
    frame #53: 0x00000001000c5654 Emacs`main + 6996
    frame #54: 0x000000018b3144e4 dyld`start + 6992
   =20
Expected behavior: At minimum, a condition-case handler that is live on the=
 Lisp stack around the erroring call should be honored, rather than the pro=
cess aborting unconditionally regardless of handlers present. More broadly,=
 treesit_delete_parser's use of Fkill_buffer (full Lisp hook evaluation wit=
h arbitrary side effects) from inside GC's sweep phase seems like the root =
design issue -- reclaiming these internal parser-associated buffers via a m=
echanism that can run arbitrary user hooks, from a context where errors are=
 unconditionally fatal, seems unsafe regardless of which specific hook func=
tion is involved.

Additional notes:

- Not specific to any major mode or third-party package -- this reproduces =
purely from core treesit.el's treesit-parse-string, which is called interna=
lly by tree-sitter-based packages (in my case, yaml-pro-ts-mode's eldoc sup=
port) as part of ordinary editing.
- undo-tree was involved in my original discovery of this (its explicit gar=
bage-collect call made the timing reliable), but is not required -- the cra=
sh reproduces from any GC event, including ones triggered automatically by =
ordinary allocation during redisplay.
- I could not determine why tramp-flush-file-function's native code hits Fm=
ake_closure's error path for this particular internal buffer (buffer-file-n=
ame nil, default-directory a plain local path) -- happy to investigate furt=
her if that's useful, but the fatal-despite-condition-case behavior is repr=
oducible and concerning independent of that specific function's correctness=
.
- Related but distinct: bug#67977 (treesit + narrowing + GC).


In GNU Emacs 31.1 (build 1, aarch64-apple-darwin25.6.0, NS
appkit-2685.70 Version 26.6.2 (Build 25G83)) of 2026-09-27 built on
Germain.local
Windowing system distributor 'Apple', version 10.3.2685
System Description:  macOS 26.6.2

Configured using:
'configure --disable-dependency-tracking --disable-silent-rules
--enable-locallisppath=3D/opt/homebrew/share/emacs/site-lisp
--infodir=3D/opt/homebrew/Cellar/emacs-plus@31/31.1/share/info/emacs
--prefix=3D/opt/homebrew/Cellar/emacs-plus@31/31.1
--with-native-compilation=3Daot --with-xml2 --with-gnutls
--without-compress-install 'CFLAGS=3D-DFD_SETSIZE=3D10000
-DDARWIN_UNLIMITED_SELECT -I/opt/homebrew/opt/sqlite/include
-I/opt/homebrew/opt/gcc/include -I/opt/homebrew/opt/libgccjit/include'
--without-dbus --with-imagemagick --with-modules --with-rsvg
--with-webp --with-xwidgets --with-ns --disable-ns-self-contained
'LDFLAGS=3D-L/opt/homebrew/opt/sqlite/lib -L/opt/homebrew/lib/gcc/16
-Wl,-rpath,/opt/homebrew/lib/gcc/16''

Configured features:
ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB

Important settings:
  value of $LC_MONETARY: en_AU.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-nonselected-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg
rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies
mm-encode mailabbrev gmm-utils mailheader sendmail mail-parse rfc2231
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils comp-run
bytecomp byte-compile comp-common rx time-date subr-x cl-loaddefs cl-lib
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal kqueue cocoa
ns lcms2 multi-tty make-network-process tty-child-frames native-compile
emacs)

Memory information:
((conses 16 56652 12009) (symbols 48 6150 0) (strings 32 14973 2418)
(string-bytes 1 451366) (vectors 16 9634)
(vector-slots 8 133745 9121) (floats 8 23 6) (intervals 56 272 0)
(buffers 1064 10))





Acknowledgement sent to Dominic Verity <dominic.verity@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#81935; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 28 Sep 2026 11:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.