Subject: Re: bug#79367: 31.0.50; magit-commit sometimes doesn't work if diff-hl-update-async is t

From: Eli Zaretskii <[email-masked]>
Date: Fri, 05 Sep 2025 17:39:10 +0300

> From: Zhengyi Fu <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 05 Sep 2025 21:36:16 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Thanks, then please show the value of the offending descriptor which
> > causes the assertion violation.  For that, please run Emacs udner GDB,
> > perform the recipe that reproduces the problem, and then type these
> > GDB commands:
> >
> >  (gdb) frame 1
> >  (gdb) print p->infd
> >
> > and tell what that produces.
> 
> The p->infd value is 8.

OK, please repeat this several times to make sure it's always 8.

If it is, then let's try to see which code leaves the .thread field
uncleared.  Like this (please run from the src directory where you
have the 'emacs' executable you have built):

  $ gdb ./emacs
  ...
  (gdb) break process.c:8731
  (gdb) run

Emacs will start and stop in init_process_emacs, on line 8731 of
process.c.  Then:

  (gdb) watch fd_callback_info[8].thread
  (gdb) commands
   > bt 5
   > continue
   > end
  (gdb) continue

The above sets a watchpoint which will stop Emacs each time we assign
some value to fd_callback_info[8].thread, and GDB will then show the
first 5 frames of the call-stack, then continue.  Now run your recipe,
until it gets SIGABRT, and post everything GDB produced until that
point.  I hope that will tell us which code fails to clear the .thread
member.

Thanks.