bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AIX and Interix also do early PID recycling.


From: Michael Haubenwallner
Subject: Re: AIX and Interix also do early PID recycling.
Date: Thu, 26 Jul 2012 23:37:37 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20120113 Thunderbird/8.0


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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]