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

From: Pip Cet <[email-masked]>
Date: Tue, 18 Feb 2025 18:16:58 +0000

Pip Cet <[email-masked]> writes:

> The asm statement is probably unnecessary.
>
> I'll try figuring out which compiler option is to blame now.

Bug#65727 appears to be the relevant one.  Maybe the fix should be
backported?

INLINE void
flush_stack_call_func (void (*func) (void *arg), void *arg)
{
  __builtin_unwind_init ();
  flush_stack_call_func1 (func, arg);
  /* Work around GCC sibling call optimization making
     '__builtin_unwind_init' ineffective (bug#65727).
     See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115132>.  */
#if defined __GNUC__ && !defined __clang__ && !defined __OBJC__
  asm ("");
#endif
}

Evgeniy, GC bugs like this one are hard to diagnose.  Sorry this took so
long.

Eli, Stefan K, what should be done with Emacs 29.4? If more binaries
like the one produced by Arch Linux are out there, people are most
likely to observe unstable Emacs systems, even if they don't end up
reporting bugs here.

Between this, the setjmp "scrambling" issues affecting MPS, and the way
-fanalyze=address breaks conservative GC, it seems like we really should
ask the GCC folks for an option to support conservative GC, and provide
appropriate builtins.  Maybe clang would follow suit.

Pip