I've been doing some testing with the latest source (pulled updates about 30 minutes ago). I'm no longer able to reproduce any problems with incorrect exit codes (Yay! Thanks for the quick turn around on that!), but I am seeing some new errors when terminating the infinite loop via ctrl-c using the test case below. This is a test case I was using previously to help isolate the original problem - I had added special_printf() calls in a few places and was using strace -m special to trigger them. All of my changes have been reverted and I'm back to using vanilla source code. This test is run with a newly built strace.exe and cygwin1.dll (the false.exe is an old one)

c:\>type test-strace.bat
@echo off
setlocal

set PATH=%CD%;%PATH%

:loop
echo test...
strace -m special false
if not errorlevel 1 (
    echo exiting...
    exit /B 1
)
goto loop


When interrupting the test run, I'll often (but not always) get the following error:

c:\>test-strace.bat
test...
test...
test...
test...
--- Process 8092, exception 40010005 at 75E26D67
Terminate batch job (Y/N)? y


Additionally, some of the Cygwin gcc built utilities that I've built for testing now occasionally hang upon interruption by ctrl-c. Basic diagnostics courtesy of gdb follow.

This utility was one used in place of strace in the test case above. It does a fork() and execlp() of its first parameter and then calls waitpid() on the child and asserts that the exit code received is 1.

If anyone knows of a way to get accurate stack traces when both gcc and Microsoft compiled modules are present, I'll be happy to regenerate the stack traces below.

$ gdb --pid=6908
GNU gdb (GDB) 7.5.50.20120815-cvs (cygwin-special)
...
Reading symbols from /home/thonermann/cygwin/test-install/bin/expect-false-execve-cygwin32.exe...done.
...
(gdb) info shared
From        To          Syms Read   Shared Object Library
0x77461000  0x775c5d1c  Yes (*)     /cygdrive/c/Windows/SysWOW64/ntdll.dll
0x75d71000 0x75e6bd58 Yes (*) /cygdrive/c/Windows/syswow64/kernel32.dll 0x74ba1000 0x74be5a08 Yes (*) /cygdrive/c/Windows/syswow64/KERNELBASE.dll 0x61001000 0x61490000 Yes /home/thonermann/cygwin/test-install/bin/cygwin1.dll
0x76271000  0x76354198  Yes (*)     /cygdrive/c/Windows/system32/user32.dll
0x74f11000  0x74f8292c  Yes (*)     /cygdrive/c/Windows/syswow64/GDI32.dll
0x76181000  0x761892f8  Yes (*)     /cygdrive/c/Windows/syswow64/LPK.dll
0x74d71000  0x74e0c9fc  Yes (*)     /cygdrive/c/Windows/syswow64/USP10.dll
0x75bf1000  0x75c9b2c4  Yes (*)     /cygdrive/c/Windows/syswow64/msvcrt.dll
0x75eb1000 0x75f4f04c Yes (*) /cygdrive/c/Windows/syswow64/ADVAPI32.dll
0x74ed1000  0x74ee8ed8  Yes (*)     /cygdrive/c/Windows/SysWOW64/sechost.dll
0x76371000  0x76445e04  Yes (*)     /cygdrive/c/Windows/syswow64/RPCRT4.dll
0x74b41000  0x74b821f0  Yes (*)     /cygdrive/c/Windows/syswow64/SspiCli.dll
0x74b31000 0x74b3b474 Yes (*) /cygdrive/c/Windows/syswow64/CRYPTBASE.dll
0x76581000  0x765c1ce0  Yes (*)     /cygdrive/c/Windows/system32/IMM32.DLL
0x75ca1000  0x75d6bebc  Yes (*)     /cygdrive/c/Windows/syswow64/MSCTF.dll
0x70e41000  0x70e8b464  Yes (*)     /cygdrive/c/Windows/system32/apphelp.dll
(*): Shared library is missing debugging information.

(gdb) info thread
  Id   Target Id         Frame
* 4    Thread 6908.0x1950 0x7747000d in ntdll!LdrFindResource_U ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
  3    Thread 6908.0x1d8c 0x7747f8e5 in ntdll!RtlUpdateClonedSRWLock ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
  2    Thread 6908.0x1d34 0x7747f8b1 in ntdll!RtlUpdateClonedSRWLock ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
1 Thread 6908.0x1344 0x7748013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll

(gdb) thread 1
[Switching to thread 1 (Thread 6908.0x1344)]
#0  0x7748013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
(gdb) bt
#0  0x7748013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
#1  0x7748013d in ntdll!RtlEnableEarlyCriticalSectionEventCreation ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
#2 0x74bb0bdd in WaitForMultipleObjectsEx () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll
#3  0x00000002 in ?? ()
#4  0x00000001 in ?? ()
#5  0x00000000 in ?? ()

(gdb) thread 2
[Switching to thread 2 (Thread 6908.0x1d34)]
#0 0x7747f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll
(gdb) bt
#0 0x7747f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7747f8b1 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x74bb0a91 in WaitForSingleObjectEx () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll
#3  0x00000034 in ?? ()
#4  0x00000000 in ?? ()

(gdb) thread 3
[Switching to thread 3 (Thread 6908.0x1d8c)]
#0 0x7747f8e5 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll
(gdb) bt
#0 0x7747f8e5 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #1 0x7747f8e5 in ntdll!RtlUpdateClonedSRWLock () from /cygdrive/c/Windows/SysWOW64/ntdll.dll #2 0x74bad348 in ReadFile () from /cygdrive/c/Windows/syswow64/KERNELBASE.dll
#3  0x00000118 in ?? ()
#4  0x00000000 in ?? ()

(gdb) thread 4
[Switching to thread 4 (Thread 6908.0x1950)]
#0 0x7747000d in ntdll!LdrFindResource_U () from /cygdrive/c/Windows/SysWOW64/ntdll.dll
(gdb) bt
#0 0x7747000d in ntdll!LdrFindResource_U () from /cygdrive/c/Windows/SysWOW64/ntdll.dll
#1  0x774ff896 in ntdll!RtlQueryTimeZoneInformation ()
   from /cygdrive/c/Windows/SysWOW64/ntdll.dll
#2  0x5dfded78 in ?? ()
#3  0x00000000 in ?? ()

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

Reply via email to