Mail Archives: cygwin-developers/1998/08/04/00:28:13
After some more detective work, I managed to get a stack trace at the time
of the hang.
The stack looks like this:
(tos) block_sig_dispatch
proc_subproc
wait4
waitpid
waitchld (function in bash)
sigchld_handler (function in bash)
call_handler
?
?
CreateProcessA
spawn_guts
spawnve
spawnv
execute_simple_command (bash function)
What has happened is a child process has died whilst CreateProcess is
creating a new process. Bash handles SIGCHLD by (eventually) calling waitpid.
Normally this won't happen, because bash blocks usually signals before
calling fork. My modifications now block signals before calling spawnv. Net
result is that I don't see the problem anymore.
Is bash misbehaving by calling waitpid from within a signal processing
function?
I guess that the sig_dispatch mutex is being grabbed somewhere before the
processing of SIGCHLD, but I can't see where.
If we are to support this sort of scenario, then we'll have to make some
changes to protect against the problem.
- Raw text -