X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; q=dns; s=default; b=F+F49skyEYPZmaOl7NmWTq8FrtMv gXiO4fovO26FQHDHmwibRcXqrslQ4shtJb8oEemnH7IFbJJ3AffAmmKs3JGkNhUF u8lcaRdM2WDZcjq8rBvqrLQACgJhgx2SuVfzQTF5sLtXWtTcP71dOCYDpfPQK7VQ ga4luA9W5mKWJ0Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id :references:to; s=default; bh=BtwE3B2nZ9ndvlfTiYufJAaK5sY=; b=On o4pmdjPKhdj94ZqnArsm/3Y3LJRn18RsYq3Nc5g6x+4i7GawA0ihgYbC31p4V4gj /XRIjbNVkf/mQ4PedFQf8eKKMzHeZ6GdddiNCys0DB9usK7PRcoEXgvqCyzF0lct ihDbZm7WwhNz85IjoGRL3O7kWajliMZz3sbuVOYOg= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: smtp6-g21.free.fr Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1822\)) Subject: Re: Intermittent failures retrieving process exit codes From: Denis Excoffier In-Reply-To: <20131115192138.GA6128@ednor.casa.cgf.cx> Date: Sun, 17 Nov 2013 14:29:45 +0100 Message-Id: <8A6F3A3D-CAA4-4072-8D24-0CE261E09990@Denis-Excoffier.org> References: <50C2498C DOT 2000003 AT coverity DOT com> <50C276AC DOT 9090301 AT mailme DOT ath DOT cx> <50D401EF DOT 9040705 AT coverity DOT com> <52844B2E DOT 5050902 AT coverity DOT com> <20131115192138 DOT GA6128 AT ednor DOT casa DOT cgf DOT cx> To: Cygwin Mailing List Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id rAHDURNF011127 On 2013-11-15 20:21, Christopher Faylor wrote: > On Fri, Nov 15, 2013 at 07:53:26PM +0100, Denis Excoffier wrote: >> On 2013-11-14 05:01, Tom Honermann wrote: >>> On 12/21/2012 01:30 AM, Tom Honermann wrote: >>>> >>>> The workaround I implemented within Cygwin was simple and sloppy. I >>>> added a call to Sleep(1000) immediately before the call to ExitThread() >>>> in wait_sig() in winsup/cygwin/sigproc.cc. Since this thread (probably) >>>> doesn't exit until the process is exiting anyway, the call to Sleep() >>>> does not adversely affect shutdown. The thread just gets terminated >>>> while in the call to Sleep() instead of exiting before the process is >>>> terminated or getting terminated while still in the call to >>>> ExitThread(). A better solution might be to avoid the thread exiting at >>>> all (so long as it can't get terminated while holding critical >>>> resources), or to have the process exiting thread wait on it. Neither >>>> of these is ideal. Orderly shutdown of multi-threaded processes is >>>> really hard to do correctly on Windows. >> >> I experience on Windows 7 (not on XP) some problems that may be related. >> I would like to test your workaround, but sigproc.cc has much changed since >> then, there is now an exit_thead function with the comment "Exit the current >> thread very carefully.". I tried to insert Sleep(1000) at the end of >> exit_thread, immediately before "ExitThread (0)", but this yielded no >> change at all. >> >> Could someone be kind enough to update the workaround for modern sigproc.cc? > > You apparently are misunderstanding the whole point of the changes to > sigproc.cc. They were to work around this very problem. Oh, i didn’t remember that. Then this must be the antivirus or something else i have to cope with. Regards, Denis Excoffier. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple