emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: address@hidden: Emacs 22.1 hung after delete-process]


From: dhruva
Subject: Re: address@hidden: Emacs 22.1 hung after delete-process]
Date: Mon, 27 Aug 2007 15:37:54 +0530

Hi,
 I have found the below patch to be the simplest and safe fix. I feel
it was just an issue if timing, thread trying to terminate on it's own
and a call the TerminateThread.
 We really do not have to terminate the thread. The sys_select closes
the pipe to any non-existent process. The _sys_read_ahead will fail
which will ensure the thread will terminate normally (graciously). It
may take an extra loop but seems the cleanest way to handle. I have
applied this patch and have used it for over a week, I keep creating
sub processes for invoking shell and git/hg and have seen no problems.
I have also tried with the OP example of launching perl and killing it
in a loop too.


diff --git a/src/w32proc.c b/src/w32proc.c
index adf5152..d4642a7 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -216,12 +216,14 @@ delete_child (child_process *cp)
          /* let the thread exit cleanly if possible */
          cp->status = STATUS_READ_ERROR;
          SetEvent (cp->char_consumed);
+#if 0
          if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0)
            {
              DebPrint (("delete_child.WaitForSingleObject (thread) failed "
                         "with %lu for fd %ld\n", GetLastError (), cp->fd));
              TerminateThread (cp->thrd, 0);
            }
+#endif
        }
       CloseHandle (cp->thrd);
       cp->thrd = NULL;

On 8/17/07, Richard Stallman <address@hidden> wrote:
>      I have put it a fix that seems to solve this problem (observed on my
>     box).
>
> Thanks for working on this.  In a few days, when you find out whether
> the fix really works right, please tell me by responding to this message.
>
> Please install your fix in EMACS_22_BASE.

IMHO, we could have the above patch in the mainstream. If someone else
wants to test it, please do so before committing in the changes.

-dky

-- 
Dhruva Krishnamurthy
Contents reflect my personal views only!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]