This is the mail archive of the
cygwin
mailing list for the Cygwin project.
strace -f hangs forever with process who creates child process
- From: Qian Hong <fracting at gmail dot com>
- To: cygwin <cygwin at cygwin dot com>
- Date: Mon, 24 Aug 2015 15:01:47 +0800
- Subject: strace -f hangs forever with process who creates child process
- Authentication-results: sourceware.org; auth=none
- Reply-to: fracting at gmail dot com
Dear list,
I just found `strace -f` hangs forever for me.
$ uname -a
CYGWIN_NT-6.1 fracting-PC 2.2.1(0.289/5/3) 2015-08-15 11:00 i686 Cygwin)
$ cat parent.sh
./child.sh
$ cat child.sh
echo haha
$ strace -f -o out.txt bash -c parent.sh #hangs forever.
I have a few C source test case here, which were originally for a Wine
bug, but could reproduce this Cygwin bug:
https://bugs.wine-staging.com/show_bug.cgi?id=525#c2
To reproduce:
(Ignore the Wine bug report itself, just copy the source. The Wine bug
itself is fixed now, with analysis which indicates something is wrong
with IsDebuggerPresent(). I refer the bug here since it might help to
triage our Cygwin issue if there is something related)
gcc spawn-parent.c -o spawn-parent.exe
gcc spawn-child.c -o spawn-child.exe
gcc dummy.c -o dummy.exe
Without strace, the above programs works fine:
$ ./spawn-parent.exe
from SPAWN parent!
from SPAWN dummy!
haha this is dummy
However, when tracing with `strace -f`, spawn-child.exe hangs:
$ strace -f -o /tmp/spawn.nested.strace.txt ./spawn-parent.exe #hangs
I read the strace document of Cygwin[1], it said:
-f, --trace-children trace child processes (toggle - default true)
[1] https://cygwin.com/cygwin-ug-net/strace.html
According to my test, `strace` without `-f` works fine, which trace
child process, as the document says.
Is it a known bug that toggle off child process doesn't work? Or did i
miss anything else?
(Note, current strace works with my needs, I don't need to toggle off
child process tracing at all, just make sure there is not a bug here)
Thanks!
--
Regards,
Qian Hong
-
http://www.winehq.org
--
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