Strange rewinddir/readdir behaviour in /usr
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
base-files (Ubuntu) |
Fix Released
|
Medium
|
Andreas Mueller |
Bug Description
I noticed this behaviour when trying to debug a gnobots crash on the Warty Live
CD. In short, this test program:
#!/usr/bin/perl
opendir DIR, ".";
print join(", ",readdir(DIR)), "\n";
rewinddir(DIR);
print join(", ",readdir(DIR)), "\n";
closedir(DIR);
only prints out one copy of the directory if it is run in the root directory or
anywhere under /usr. If run in /home then it prints out two copies of the
directory listing as expected. In gnobots this caused a crash because files it
expects to be there on the second scan of a directory don't appear. I expect
this would cause strange behaviour in other programs. It is not clear whether
rewinddir or readdir is the cause of the problem since rewinddir doesn't report
success or failure.
gnobots is written in C, so I suspect this is an underlying libc problem rather
than a perl problem.
I tested this on a laptop with the CD run in safe mode so the minimum of device
drivers (and possibly complicating hardware) was loaded. The system has 374MB of
RAM which did not appear to be anywhere near exhausted. The gnobots crash was
originally noticed on another persons system, so I assume that this is not an
isolated case.
I do not know if it is an issue on the new Hoary Live CD since I do not
currently have the bandwidth to download it conveniently.
I have been informed out of band that this has been fixed for Hoary. Nothing to
see here, move along.