Subject: Re: bug#76327: 29.4; random segfaults after switch to tree-sitter

From: Evgeniy Dushistov <[email-masked]>
Date: Wed, 19 Feb 2025 19:43:23 +0300

On Wed, Feb 19, 2025 at 06:32:09PM +0200, Eli Zaretskii wrote:
> Is this still in Emacs 29.4, only with the above patch applied?  Or is
> this a different version of Emacs?

Yes, it emacs 29.4 with

Index: emacs-29.4/src/lisp.h
===================================================================
--- emacs-29.4.orig/src/lisp.h
+++ emacs-29.4/src/lisp.h
@@ -4229,8 +4229,14 @@ extern void mark_memory (void const *sta
 INLINE void
 flush_stack_call_func (void (*func) (void *arg), void *arg)
 {
-  __builtin_unwind_init ();
-  flush_stack_call_func1 (func, arg);
+  volatile bool repeat = true;
+  while (repeat)
+    {
+      __builtin_unwind_init ();
+      asm volatile ("" : : : "memory");
+      flush_stack_call_func1 (func, arg);
+      repeat = false;
+    }
 }
 
 extern void garbage_collect (void);

-- 
/Evgeniy