[gnu.bash.bug] 1.03 bug in handling eval and .

ra@is.uu.no (Robert Andersson) (09/09/89)

This is release 1.03 running on an NCR Tower 32/400 running NCR's OS
release 2.01.00 (SYSV.2 compatible), and using NCR's C-compiler.

JOB_CONTROL is *not* defined when compiling bash, I don't know if that
makes a difference. I have also applied the patches I sent a couple of
days ago but I believe they are not relevant to this problem.

Recreate the bug by:
bash$ eval ls

or:
bash$ . some_shell_script

The symptom is that bash gives an error message stating that 
errno=No child processes

I believe this happens because of a bug in:
execute_cmd.c
  execute_command_internal()
    case cm_simple:
It calls wait_for if execute_simple_command() forked a child. The
problem is that execute_simple_command may call
execute_command_internal again recursively. The second call waits for
its child, but, and this is the bug, so does the first call. Thus the
second wait_for is called with the same pid as the first one and fails.

Robert Andersson, International Systems, Oslo, Norway
Internet:         ra@is.uu.no
UUCP:             ...!{uunet,mcvax,ifi}!is.uu.no!ra