From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Re: [andrew.maguire@ge.com: Emacs 22.1 hung after delete-process] Date: Thu, 16 Aug 2007 19:39:11 +0530 Message-ID: References: <46C404AD.8040908@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1187273361 1043 80.91.229.12 (16 Aug 2007 14:09:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2007 14:09:21 +0000 (UTC) Cc: Glenn Morris , rms@gnu.org, emacs-devel@gnu.org To: "Jason Rumney" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 16 16:09:19 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ILg2J-0006N4-AQ for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2007 16:09:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILg2I-00079q-RQ for ged-emacs-devel@m.gmane.org; Thu, 16 Aug 2007 10:09:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ILg2F-00075B-1r for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:09:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ILg2D-00071K-Fc for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:09:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ILg2D-000717-Cn for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:09:13 -0400 Original-Received: from nf-out-0910.google.com ([64.233.182.188]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1ILg2C-0005Ef-Jp for emacs-devel@gnu.org; Thu, 16 Aug 2007 10:09:12 -0400 Original-Received: by nf-out-0910.google.com with SMTP id f5so153519nfh for ; Thu, 16 Aug 2007 07:09:11 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QHyCMiIcHVsahiq3PfCV8RmukV0FFfic0oLwekA3dMKuWMdx2dp90a8ECWZb51lZaiOrX0wHqRHv8ojFYc62ZcQ/OLaIszNiX9dvGm/UP4NTSQ0Sv2fnQrOMIY7xoUPvcgmQTlt2JOZNuRl+KMZzhnZF8k2DaUfbPA7EHRu+NpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BaHTEDWmtFrTx2+LQKzeJsilCguS0s+eiN6g+MvK2Olcc5dE550YthfhVvlTDXE/IcqKq+asjwRzN+FxbwEKwbuoEHoP3tCMglWdDVq0HKdVYFmajKCNd2nsD8dCubHbaTJw+Y9CjKUWoFuZ1Faq5Do85KaJ4k59MFeDDA7BZ4M= Original-Received: by 10.78.21.7 with SMTP id 7mr651053huu.1187273351411; Thu, 16 Aug 2007 07:09:11 -0700 (PDT) Original-Received: by 10.78.206.20 with HTTP; Thu, 16 Aug 2007 07:09:11 -0700 (PDT) In-Reply-To: Content-Disposition: inline X-Detected-Kernel: Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76629 Archived-At: Hi, I have put it a fix that seems to solve this problem (observed on my box). I find the issue in using SetEvent() and not waiting long enough before calling TerminateThread(). Either we could remove the call the TerminateThread() or increase the delay (that I have done) or ideally use a critical section (add it in the child_process structure). -dky E:\cache\build\emacs\src [dky]hg cdiff w32proc.c *** emacs.58583440b48b\src\w32proc.c 2007-08-16 19:11:29.218750000 +0530 --- E:\cache\build\emacs\src\w32proc.c 2007-08-16 19:02:44.828125000 +0530 *************** delete_child (child_process *cp) *** 216,222 **** /* let the thread exit cleanly if possible */ cp->status = STATUS_READ_ERROR; SetEvent (cp->char_consumed); ! if (WaitForSingleObject (cp->thrd, 1000) != WAIT_OBJECT_0) { DebPrint (("delete_child.WaitForSingleObject (thread) failed " "with %lu for fd %ld\n", GetLastError (), cp->fd)); --- 216,222 ---- /* let the thread exit cleanly if possible */ cp->status = STATUS_READ_ERROR; SetEvent (cp->char_consumed); ! if (WaitForSingleObject (cp->thrd, INFINITE) != WAIT_OBJECT_0) { DebPrint (("delete_child.WaitForSingleObject (thread) failed " "with %lu for fd %ld\n", GetLastError (), cp->fd)); -- Dhruva Krishnamurthy Contents reflect my personal views only!