This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

strace -f hangs forever with process who creates child process

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

$ cat
echo haha

$ strace -f -o out.txt bash -c #hangs forever.

I have a few C source test case here, which were originally for a Wine
bug, but could reproduce this Cygwin bug:

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)


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)


Qian Hong


Problem reports:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]