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 14:18:07 +0300

> 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);