Open p5pRT opened 16 years ago
Test 6 of ext/File/Glob/t/basic.t fails sometimes for me. It's a test that creates a directory which is unreadable\, then tries to glob it\, to make sure that the error gets returned.
It basically does this:
$ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\<
Um. Yes. Like that. Where -2 is what it expects\, and 0 (no error) is not.
So\, is this perl being buggy\, or a race condition in the filing system?
Surely if I create a directory\, I expect it to exist in the next syscall?
[And if it is OS X that is being buggy\, it's case sensitive journalled hfs. And bloody OS X 10.5 has no decent equivalent of strace/truss/ktrace\, so I can't trivially log the syscalls as non-root\, and then diff the output. That's one thing that 10.4 was better at]
I'm leaning towards bsd_glob.c being buggy (is it up to date?) as I wrote a C program to create\, fail to open and delete a directory\, all in a tight loop\, and it works just perfectly.
Nicholas Clark
On Tue Mar 04 09:15:29 2008\, nicholas wrote:
This is a bug report for perl from nick@ccl4.org\, generated with the help of perlbug 1.36 running under perl 5.11.0.
----------------------------------------------------------------- [Please enter your report here]
Test 6 of ext/File/Glob/t/basic.t fails sometimes for me. It's a test that creates a directory which is unreadable\, then tries to glob it\, to make sure that the error gets returned.
It basically does this:
$ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\<
Would it be a good idea to expand the test to try it a number of times? (so that it can be picked up by the smoke reports if it\, occasionanly\, fails on other platforms)
Kind regards\,
Bram
The RT System itself - Status changed from 'new' to 'open'
On Sun Jun 29 02:41:54 2008\, animator wrote:
On Tue Mar 04 09:15:29 2008\, nicholas wrote:
This is a bug report for perl from nick@ccl4.org\, generated with the help of perlbug 1.36 running under perl 5.11.0.
----------------------------------------------------------------- [Please enter your report here]
Test 6 of ext/File/Glob/t/basic.t fails sometimes for me. It's a test that creates a directory which is unreadable\, then tries to glob it\, to make sure that the error gets returned.
It basically does this:
$ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' 0 >\< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie"\, 0; my @a = bsd_glob("Pie/*"\, GLOB_ERR); print GLOB_ERROR\, " >@a\<"; rmdir "Pie"' -2 >\<
I cannot reproduce this on Snow Leopard with 5.6.2\, 5.8.1-4\, 5.10.0-1\, 5.12.0 or 5.13.5.
Would it be a good idea to expand the test to try it a number of times? (so that it can be picked up by the smoke reports if it\, occasionanly\, fails on other platforms)
Has a test been added?
It looks like no one but Nick has ever been able to reproduce this. Are you still seeing this on recent perls on Mac?
-- Respectfully\, Dan Collins
@dcollinsn - Status changed from 'open' to 'stalled'
From @nwc10
Created by @nwc10
Test 6 of ext/File/Glob/t/basic.t fails sometimes for me. It's a test that creates a directory which is unreadable, then tries to glob it, to make sure that the error gets returned.
It basically does this:
$ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/*", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' 0 ><
[snip]
@nwc10 Nick, have you been able to reproduce this error since your original report?
Which test in the current ext/File-Glob/t/basic.t corresponds to the one that was failing for you twelve years ago?
Is the problem now moot since File::Glob::glob has been yanked as of 5.30?
$ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' 0 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' -2 >< $ ./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "Pie", 0; my @a = bsd_glob("Pie/", GLOB_ERR); print GLOB_ERROR, " >@a<"; rmdir "Pie"' 0 ><
Um. Yes. Like that. Where -2 is what it expects, and 0 (no error) is not.
So, is this perl being buggy, or a race condition in the filing system?
Surely if I create a directory, I expect it to exist in the next syscall?
[And if it is OS X that is being buggy, it's case sensitive journalled hfs. And bloody OS X 10.5 has no decent equivalent of strace/truss/ktrace, so I can't trivially log the syscalls as non-root, and then diff the output. That's one thing that 10.4 was better at]
I'm leaning towards bsd_glob.c being buggy (is it up to date?) as I wrote a C program to create, fail to open and delete a directory, all in a tight loop, and it works just perfectly.
Thank you very much. Jim Keenan
I can reproduce this on CentOS Linux release 7.8.2003 (Core). I got some failed tests when I tried to build Perl5-32.1. When I run
./perl -Ilib -MFile::Glob=:glob -wle 'mkdir "pie", 0; my @a = bsd_glob("pie/*", GLOB_ERR); print GLOB_ERROR,"\n"; rmdir "pie"'
I got "0" all the time when the test expects a non-zero.
Best regards, Kevin
Migrated from rt.perl.org#51410 (status was 'stalled')
Searchable as RT51410$