We are seeing a very rare race problem that is only showing up with random pid turned on. This is with stock 2.6.7 and 2.4.26 and grsec 2.0.1.
If you try the following bash script:
- Code: Select all
#!/bin/bash
i=0
die() {
echo -e "\n$i: $@" >&2
exit 1
}
while :; do
(( i++ ))
mv file file.old || die "mv failed"
if [ ! -f file.old ]; then
die "copy of file -> file.old failed, wtf??"
fi
if [ -f file ]; then
die "remove of file failed, wtf??"
fi
mv file.old file || die "mv2 failed"
if [ ! -f file ]; then
die "copy of file.old -> file failed, wtf??"
fi
if [ -f file.old ]; then
die "remove of file.old failed, wtf??"
fi
done
will fail randomly. If you run this from within a tmpfs partition it fails usually in under a minute. On a normal partition, it fails in 30 minutes or so.
Can anyone else replicate this, or have any ideas on what's going on? If we turn off random pids, we can't replicate this problem.
Cheers,
Alex