From: dhruva <dhruvakm@gmail.com>
To: rms@gnu.org
Cc: rgm@gnu.org, emacs-devel@gnu.org, jasonr@gnu.org
Subject: Re: [andrew.maguire@ge.com: Emacs 22.1 hung after delete-process]
Date: Mon, 27 Aug 2007 15:37:54 +0530 [thread overview]
Message-ID: <e3f230850708270307o58b6d740sb3edab97260ffae2@mail.gmail.com> (raw)
In-Reply-To: <E1ILplK-0002de-D4@fencepost.gnu.org>
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 <rms@gnu.org> 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!
next prev parent reply other threads:[~2007-08-27 10:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-15 18:21 [andrew.maguire@ge.com: Emacs 22.1 hung after delete-process] Richard Stallman
2007-08-16 3:24 ` Glenn Morris
2007-08-16 4:46 ` dhruva
2007-08-17 0:32 ` Richard Stallman
2007-08-16 8:02 ` Jason Rumney
2007-08-16 12:42 ` dhruva
2007-08-16 14:09 ` dhruva
2007-08-16 17:04 ` dhruva
2007-08-16 19:41 ` Eli Zaretskii
2007-08-17 0:32 ` Richard Stallman
2007-08-17 5:27 ` dhruva
2007-08-27 10:07 ` dhruva [this message]
2007-09-02 17:02 ` Jason Rumney
2007-08-17 13:43 ` Jason Rumney
2007-08-17 17:31 ` dhruva
2007-08-17 20:40 ` Jason Rumney
2007-08-19 7:42 ` dhruva
2007-08-22 6:29 ` dhruva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e3f230850708270307o58b6d740sb3edab97260ffae2@mail.gmail.com \
--to=dhruvakm@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=jasonr@gnu.org \
--cc=rgm@gnu.org \
--cc=rms@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).