Package: procps
Version: 3.2.1-2
Severity: normal

Make an executable file "testlock" containing: 
"
#!/bin/bash
ps -p $$ -o pid,args > about.$$
if ! cat about.$$ | egrep -q '[0-9]'
then
        cp about.$$ error.$$.old
        ps -p $$ -o pid,args > error.$$.new
fi
rm about.$$
echo $0 $@
"

Then issue a command
"
for f in `seq 1000`; do ( ./testlock $f & ); done
"

After all processes "testlock" have finished try to list contents of
local directory. No files error.* should be seen, but THEY ARE
PRESENT. Why? 


Comments:

1. If you start processes sequentially, that is 
"
for f in `seq 1000`; do ./testlock $f; done
"
then no files error.* are made. 

2. In files error.*.old you can see ps headers, but no information
on current process $$. 

3. Adding sleep or sync around command ps, and also duplicating
command ps at the beginning doesn't solve the problem. 

4. Running scripts on slower machines makes more error.* files. On
fast computers you will have to run several thousand times.




-- 
www.TOTALIZM.com    UFO occupation
http://jan-pajak.com/predators.htm







-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to