public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* strace -f hangs forever with process who creates child process
@ 2015-08-24  7:02 Qian Hong
  2015-08-24 13:05 ` Nellis, Kenneth
  0 siblings, 1 reply; 7+ messages in thread
From: Qian Hong @ 2015-08-24  7:02 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: strace -f hangs forever with process who creates child process
  2015-08-24  7:02 strace -f hangs forever with process who creates child process Qian Hong
@ 2015-08-24 13:05 ` Nellis, Kenneth
  2015-08-24 13:37   ` Roger Wells
  0 siblings, 1 reply; 7+ messages in thread
From: Nellis, Kenneth @ 2015-08-24 13:05 UTC (permalink / raw)
  To: cygwin

From: Qian Hong
> 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.

FWIW, this also seems to hang for me, but can't confirm that it 
hangs "forever", as I didn't wait that long. Ctrl/C-ing out works, 
but that takes several seconds to take effect. And then I can't 
delete out.txt:

$ rm -f out.txt
rm: cannot remove ‘out.txt’: Device or resource busy
$ 

Commands 'ps' and 'who' don't indicate any other processes, but
Task Manager shows another bash process. After killing that process
I am then able to delete out.txt.

--Ken Nellis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: strace -f hangs forever with process who creates child process
  2015-08-24 13:05 ` Nellis, Kenneth
@ 2015-08-24 13:37   ` Roger Wells
  2015-08-24 14:03     ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Roger Wells @ 2015-08-24 13:37 UTC (permalink / raw)
  To: cygwin

On 08/24/2015 09:05 AM, Nellis, Kenneth wrote:
> From: Qian Hong
>> 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.
> 
> FWIW, this also seems to hang for me, but can't confirm that it 
> hangs "forever", as I didn't wait that long. Ctrl/C-ing out works, 
> but that takes several seconds to take effect. And then I can't 
> delete out.txt:
> 
> $ rm -f out.txt

I also can confirm this on the same cygwin release but for x86_64:

uname -a
CYGWIN_NT-6.1 rwells-x220 2.2.1(0.289/5/3) 2015-08-20 11:42 x86_64 Cygwin



-- 
Roger Wells, P.E.
leidos
221 Third St
Newport, RI 02840
401-847-4210 (voice)
401-849-1585 (fax)
roger.k.wells@leidos.com

--
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: strace -f hangs forever with process who creates child process
  2015-08-24 13:37   ` Roger Wells
@ 2015-08-24 14:03     ` Corinna Vinschen
  2015-08-24 16:50       ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2015-08-24 14:03 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

On Aug 24 09:37, Roger Wells wrote:
> On 08/24/2015 09:05 AM, Nellis, Kenneth wrote:
> > From: Qian Hong
> >> 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.
> > 
> > FWIW, this also seems to hang for me, but can't confirm that it 
> > hangs "forever", as I didn't wait that long. Ctrl/C-ing out works, 
> > but that takes several seconds to take effect. And then I can't 
> > delete out.txt:
> > 
> > $ rm -f out.txt
> 
> I also can confirm this on the same cygwin release but for x86_64:

No more metoos required, thank you.  It's a generic problem when trying
to trace forking/spawning parents without also tracing their children.

Having said that, I don't know what the cause is, but I guess that
"nobody did it" for a while.  Also, "don't do that" for now ;)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: strace -f hangs forever with process who creates child process
  2015-08-24 14:03     ` Corinna Vinschen
@ 2015-08-24 16:50       ` Corinna Vinschen
  2015-08-25  3:18         ` Qian Hong
  0 siblings, 1 reply; 7+ messages in thread
From: Corinna Vinschen @ 2015-08-24 16:50 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 1421 bytes --]

On Aug 24 16:03, Corinna Vinschen wrote:
> On Aug 24 09:37, Roger Wells wrote:
> > On 08/24/2015 09:05 AM, Nellis, Kenneth wrote:
> > > From: Qian Hong
> > >> 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.
> > > 
> > > FWIW, this also seems to hang for me, but can't confirm that it 
> > > hangs "forever", as I didn't wait that long. Ctrl/C-ing out works, 
> > > but that takes several seconds to take effect. And then I can't 
> > > delete out.txt:
> > > 
> > > $ rm -f out.txt
> > 
> > I also can confirm this on the same cygwin release but for x86_64:
> 
> No more metoos required, thank you.  It's a generic problem when trying
> to trace forking/spawning parents without also tracing their children.
> 
> Having said that, I don't know what the cause is, but I guess that
> "nobody did it" for a while.  Also, "don't do that" for now ;)

Please try the latest developer snapshot from https://cygwin.com/snapshots/
It should fix the issue.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: strace -f hangs forever with process who creates child process
  2015-08-24 16:50       ` Corinna Vinschen
@ 2015-08-25  3:18         ` Qian Hong
  2015-08-25  8:36           ` Corinna Vinschen
  0 siblings, 1 reply; 7+ messages in thread
From: Qian Hong @ 2015-08-25  3:18 UTC (permalink / raw)
  To: cygwin

Hi Corinna,

On Tue, Aug 25, 2015 at 12:50 AM, Corinna Vinschen
<corinna-cygwin@cygwin.com> wrote:
> Please try the latest developer snapshot from https://cygwin.com/snapshots/
> It should fix the issue.

Thanks very much for the fix. I've retested on both Win7 and Wine
(Wine Staging 1.7.50), and I can confirm now `strace -f` works fine on
both platform. No longer hangs, also child process is not traced.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: strace -f hangs forever with process who creates child process
  2015-08-25  3:18         ` Qian Hong
@ 2015-08-25  8:36           ` Corinna Vinschen
  0 siblings, 0 replies; 7+ messages in thread
From: Corinna Vinschen @ 2015-08-25  8:36 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 659 bytes --]

On Aug 25 11:18, Qian Hong wrote:
> Hi Corinna,
> 
> On Tue, Aug 25, 2015 at 12:50 AM, Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > Please try the latest developer snapshot from https://cygwin.com/snapshots/
> > It should fix the issue.
> 
> Thanks very much for the fix. I've retested on both Win7 and Wine
> (Wine Staging 1.7.50), and I can confirm now `strace -f` works fine on
> both platform. No longer hangs, also child process is not traced.

Thanks for testing!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-08-25  8:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-24  7:02 strace -f hangs forever with process who creates child process Qian Hong
2015-08-24 13:05 ` Nellis, Kenneth
2015-08-24 13:37   ` Roger Wells
2015-08-24 14:03     ` Corinna Vinschen
2015-08-24 16:50       ` Corinna Vinschen
2015-08-25  3:18         ` Qian Hong
2015-08-25  8:36           ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).