Subject: 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 16:26:04 +0300

> From: Zhengyi Fu <[email-masked]>
> Cc: [email-masked],  [email-masked],  [email-masked]
> Date: Fri, 05 Sep 2025 21:19:02 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> >> Cc: [email-masked], [email-masked], [email-masked], [email-masked]
> >> Date: Fri, 05 Sep 2025 13:42:09 +0300
> >> From: Eli Zaretskii <[email-masked]>
> >> 
> >> > From: Zhengyi Fu <[email-masked]>
> >> > Cc: Spencer Baugh <[email-masked]>,  [email-masked],
> >> >   [email-masked],  [email-masked]
> >> > Date: Fri, 05 Sep 2025 14:51:42 +0800
> >> > 
> >> > > I feel that we are splitting hair, so I went ahead and installed the
> >> > > last agreed-to version of the patch.
> >> > 
> >> > I got an assertion failure when testing the latest master.
> >> 
> >> What is the recipe for reproducing this?
> >
> > Also, does the below fix the problem?
> >
> > diff --git a/src/process.c b/src/process.c
> > index fa003c2..e39e02f 100644
> > --- a/src/process.c
> > +++ b/src/process.c
> > @@ -4831,7 +4831,11 @@ deactivate_process (Lisp_Object proc)
> >    /* Beware SIGCHLD hereabouts.  */
> >  
> >    for (i = 0; i < PROCESS_OPEN_FDS; i++)
> > -    close_process_fd (&p->open_fd[i]);
> > +    {
> > +      close_process_fd (&p->open_fd[i]);
> > +      fd_callback_info[p->open_fd[i]].thread = NULL;
> > +      fd_callback_info[p->open_fd[i]].waiting_thread = NULL;
> > +    }
> >  
> >    inchannel = p->infd;
> >    eassert (inchannel < FD_SETSIZE);
> 
> No.  I can still reproduce this after applying the patch.

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.