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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=GdbJNa90fo/qQQXS 6btAa0S9AGbk7lQ8kkNGt94FhEtPDAI2oBxTZ4L5KB4wG+KvqsvL5JV+YKjBcy8A /mW/CE/x3N4WgrXbwO/RaAl7QP+qdc9CMzCbSu2mVwi89R21EHwWEwTV7Qw4CGUH 4aNcTjphGF9mIF9Sj3J8gPgZ9FM= 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:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=default; bh=+PFnq3ZonDDw8Mi+kEqcGa OZd2c=; b=L980TSwvl4dyyRhRF4EkBpJhqwnwemeQWR6x7C/tVbP1wk8l8ePm0h r1dcm+Hbvq+J510zr6pu9VsSdkJkG7NFbMvaZXut0cWg3Z5rt8SB2DqLkZhuYxdr GFh9j2wsHVmeZMAYXeENZlARwlmRl88Hip/P2sR7ZMTFAn/VSzLGY= 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=3.1 required=5.0 tests=AWL,BAYES_99,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: na01-bl2-obe.outbound.protection.outlook.com Message-ID: <52869D01.2000405@coverity.com> Date: Fri, 15 Nov 2013 17:15:29 -0500 From: Tom Honermann User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Denis Excoffier , Cygwin Mailing List CC: Subject: Re: Intermittent failures retrieving process exit codes 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> In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BN1PR05CA016.namprd05.prod.outlook.com (10.141.56.26) To BN1PR05MB456.namprd05.prod.outlook.com (10.141.59.26) X-Forefront-PRVS: 0031A0FFAF X-Forefront-Antispam-Report: SFV:NSPM;SFS:(377454003)(52314003)(479174003)(24454002)(199002)(189002)(51704005)(377424004)(80022001)(46102001)(31966008)(65956001)(83322001)(56776001)(80316001)(74662001)(66066001)(50986001)(19580395003)(33656001)(47976001)(74502001)(47446002)(54316002)(81342001)(36756003)(80976001)(4396001)(87976001)(49866001)(47736001)(81816001)(74366001)(81686001)(81542001)(56816003)(50466002)(77982001)(51856001)(79102001)(54356001)(42186004)(76796001)(74876001)(76786001)(74706001)(53806001)(64126003)(83072001)(76482001)(65806001)(23746002)(59896001)(59766001)(63696002)(69226001)(77096001)(47776003)(83506001)(85306002);DIR:OUT;SFP:;SCL:1;SRVR:BN1PR05MB456;H:[192.168.1.16];CLIP:96.253.80.174;FPR:;RD:InfoNoRecords;A:1;MX:1;LANG:en; X-OriginatorOrg: coverity.com X-IsSubscribed: yes On 11/15/2013 01:53 PM, 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? Hi Denis. Cygwin versions 1.7.18 and later contain a workaround for this issue. If you are running something older than that, I highly encourage you to upgrade. Many stability related fixes have been made in more recent versions. > Very briefly, my problem is that when i "tar xf —use-compress-program=xz", i > get: > tar: Unexpected EOF in archive > tar: Unexpected EOF in archive > tar: Error is not recoverable: exiting now > and the last file of the archive is truncated at some 512bytes block. This > occurs on Windows 7 (not on XP); with xz-5.1.3alpha (not with xz-5.1.2alpha or > xz-5.0.5); never on most tar.xz files; almost always on some (rare) tar.xz files > (one notable example is bc-1.06.95.tar.bz2 bunzip2’ed and then xz’ed); depends > on the .tar file itself, not on the option (like -9e, -0) used to create the > .tar.xz; never with "tar tf"; and with all tar’s i have tested. The return code > of all the involved xz -d commands is always zero though. Perhaps after all, this > is unrelated? This doesn't sound related to the intermittent incorrect exit code defect to me. I'm afraid I don't have other explanations for what you are experiencing though. Tom. -- 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