This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Intermittent failures retrieving process exit codes
- From: Tom Honermann <thonermann at coverity dot com>
- To: Denis Excoffier <cygwin at Denis-Excoffier dot org>, Cygwin Mailing List <cygwin at cygwin dot com>
- Cc: <lasse dot collin at tukaani dot org>
- Date: Fri, 15 Nov 2013 17:15:29 -0500
- Subject: Re: Intermittent failures retrieving process exit codes
- Authentication-results: sourceware.org; auth=none
- 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> <EFA04305-A94A-46F4-BCCE-8FB3ADA45E72 at Denis-Excoffier dot org>
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