On 07/26/12 20:29, Chet Ramey wrote:
OK, we have some data, we have a hypothesis, and we have a way to test it.
Let's test it.
Michael, please apply the attached patch, disable RECYCLES_PIDS, and run
your tests again. This makes the check for previously-saved exit statuses
unconditional.
Let's see if this is the one change of significance.
Nope, doesn't fix the problem, even if it might be necessary though
to not mix up stored exitstates.
Somehow this is related to last_made_pid being preserved across childs
created for { $() } or { `` }.
In execute_command_internal(), last_made_pid still holds the 128 forks
old (first) PID, causing wait_for() to be not run when getting the same
PID by execute_simple_command() again.
However, I've been able to create a short testcase now:
---
#! /bin/bash
/bin/false # make first child
for x in {1..127}; do
x=$( : ) # make CHILD_MAX-1 more childs
done
# breaks when first child's PID is recycled here
if /bin/false; then
echo BOOM
exit 1
fi
echo GOOD
---
/haubi/