From: TYann AT vet DOT com DOT au (Trevor Yann) Subject: Re: spawn problems (windows 98?) 4 Aug 1998 00:28:13 -0700 Message-ID: <3.0.5.32.19980804165143.007de820.cygnus.cygwin32.developers@mail.mel.cybec.com.au> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: cygwin32-developers AT cygnus DOT com 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.