Subject: Help with waitpid hanging
From: [email-masked] (Craig Setera)

10 Jul 1998 07:43:22 -0700
Message-ID: <5010400024779623000002L032*.cygnus.gnu-win32@MHS>
Mime-Version: 1.0
Content-Type: text/plain
To: <[email-masked]>

I'm hoping somebody who has a better understanding of cygwin32 might be able to
help me to understand what is happening with the following trace from the
support DLL.  In this trace, pid has been asked to end via the datastream by
pid 1086 (its parent) and has done so (NT task manager proves that).  Why then,
does the following call to waitpid() end up hanging infinitely then?  It
appears (to my untrained mind) that it should basically return immediately.  In
fact, somewhere in this trace I see that it "reaped" the zombie process 1089.
It seems that it should return successfully at that point, but instead it is
hung indefinitely.  I have the CDK sources, but to be honest, I just can't get
my head around this stuff.

The structure of processes prior to the waitpid call is that pid 1086 is the
parent of both 1087 and 1089.  I have asked 1089 to exit, but 1087 is supposed
to remain active.  Also, it has been proven that if the executable (once
started is always running) behind pid 1087 is never started, that this hang
will never occur.

Help!  I would appreciate any help that anyone can give me on this.

Thanks,
Craig

Calling waitpid on pid = 1089
(d:\unix\usr\local\bin\gimp.exe 1086) <0> fhandler_base::write: after write,
name gimp.out, rpos 928
(d:\unix\usr\local\bin\gimp.exe 1086) <0> _write: 30 = write (2, 0x285F578, 30)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: calling proc_subproc, pid =
1089, options = 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 5, 268785180
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: waiting for
sig_dispatch (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wval->pid 1089,
wval->options 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: nchildren = 2, nzombies =
0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: checking alive children
(d:\unix\usr\local\bin\gimp.exe 1086) <0> stopped_or_terminated: considering
pid 1087
(d:\unix\usr\local\bin\gimp.exe 1086) <0> stopped_or_terminated: considering
pid 1089
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: returning -1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wait activated 0xF0,
0xF0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: releasing
sig_dispatch mutex (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_dispatch_pending: entering
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 3, 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: current thread id
0x3F != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: pid 1089[1] terminated,
handle 0xE0, nchildren = 2, nzombies = 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> remove_child: removing [1], pid 1089,
handle 0xE0, nchildren 2
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: pid 1086, signal 20, its_me
1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: processing signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: Got signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: signal 20, about to call
0x48684C
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: got sig_dispatch lock
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: Suspending 0xB4
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: suspend said 0 error 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 4, 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: current thread id
0x39 != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: clear waiting threads
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: clearing waiting
thread, pid waited for = 1089
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: finished clearing
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: current thread id
0x39 != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: Waiting for thiscomplete
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: calling proc_subproc, pid =
-1, options = 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 5, 268785180
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: waiting for
sig_dispatch (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: returning
(d:\unix\usr\local\bin\gimp.exe 1086) <0> unlock_cs: released sig_dispatch
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: releasing sig_was_dispatched
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wval->pid -1,
wval->options 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: nchildren = 1, nzombies =
1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> stopped_or_terminated: considering
pid 1089
(d:\unix\usr\local\bin\gimp.exe 1086) <0> remove_zombie: removing 0, pid 1089,
nzombies 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wait activated 0xF0.
Reaped zombie.
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: releasing
sig_dispatch mutex (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_dispatch_pending: entering
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: returning 0 from sending
signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: finished processing
terminated/stopped child
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: current thread id
0x3F != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_subproc: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_subproc: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: 0 = WaitForSingleObject (...)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: -1, 0x285FBAC(0), 1 = 1089
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: calling proc_subproc, pid =
-1, options = 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 5, 268785180
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: waiting for
sig_dispatch (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wval->pid -1,
wval->options 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: nchildren = 1, nzombies =
0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: checking alive children
(d:\unix\usr\local\bin\gimp.exe 1086) <0> stopped_or_terminated: considering
pid 1087
(d:\unix\usr\local\bin\gimp.exe 1086) <0> checkstate: returning -1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: WNOHANG and no
terminated children, 0xF0, 0xF0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: wait activated 0xF0.
Reaped zombie.
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: releasing sig_dis
patch mutex (0x10)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_dispatch_pending: entering
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: 0 = WaitForSingleObject (...)
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait4: -1, 0x285FBAC(0), 1 = 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> lock_cs: sig_dispatch 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> set_process_mask: old mask = 100000,
new mask = 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> unlock_cs: released sig_dispatch
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_dispatch_pending: entering
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <10> proc_subproc: args: 3, 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: current thread id
0x3F != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: pid 1087[0] terminated,
handle 0xC0, nchildren = 1, nzombies = 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> remove_child: removing [0], pid 1087,
handle 0xC0, nchildren 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: pid 1086, signal 20, its_me
1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: awake
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: processing signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: Got signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: signal 20, about to call
0x48684C
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: got sig_dispatch lock
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: Suspending 0xB4
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: suspend said 0 error 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: args: 4, 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> block_sig_dispatch: current thread id
0x39 != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: clear waiting threads
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: finished clearing
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: current thread id
0x39 != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: Waiting for thiscomplete
(d:\unix\usr\local\bin\gimp.exe 1086) <0> call_handler: returning
(d:\unix\usr\local\bin\gimp.exe 1086) <0> unlock_cs: released sig_dispatch
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_handle: returning 1
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: releasing sig_was_dispatched
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_sig: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> sig_send: returning 0 from sending
signal 20
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: finished processing
terminated/stopped child
(d:\unix\usr\local\bin\gimp.exe 1086) <0> allow_sig_dispatch: current thread id
0x3F != maintid 0x74
(d:\unix\usr\local\bin\gimp.exe 1086) <0> proc_subproc: returning 0
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_subproc: looping
(d:\unix\usr\local\bin\gimp.exe 1086) <0> wait_subproc: looping

Craig Setera
AS/400 Enterprise Java Development
IBM Rochester
[email-masked]
(507) 253-3387 - Tie: 553-3387
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".