develooper Front page | perl.perl5.porters | Postings from June 2012

[perl #113796] blead: lib/File/stat.t failure on AIX

Thread Previous | Thread Next
Father Chrysostomos via RT
June 23, 2012 23:59
[perl #113796] blead: lib/File/stat.t failure on AIX
Message ID:
On Sat Jun 23 23:38:36 2012, sprout wrote:
> On Fri Jun 22 15:18:16 2012, wrote:
> > Trying to test another patch, I copy perl from git blead to my AIX 6.1
> > box, where perl 5.16.0 is compiling and testing just fine and get:
> > 
> > ../lib/File/stat.t
> > (Wstat: 256 Tests: 5008 Failed: 1)
> >   Failed test:  4911
> >   Non-zero exit status: 1
> > 
> > Which is:
> > 
> > not ok 4911 - correct overload for -l for ./perl
> I just tried compiling the smoke-me/slop (slab for ops) branch with g++
> instead of gcc, and I get the same failure on Mac OS X.  I doubt the
> slab allocator has anything to do with it.

It seems that gcc produces this:

$ ./perl -Ilib -e 'warn $^X'
/Users/sprout/Perl/perl.git/perl at -e line 1.

while g++ produces this:

$ ./perl -Ilib -e 'warn $^X'
./perl at -e line 1.

I had no idea the compiler could affect $^X.  gcc seems to be making
perl resolve symlinks, too, because I get the same result in the t
directory.  (I may be misdiagnosing it.)

The script is using $^X for testing, which is why it could produce
different results.

In any case, this produces the same output for both compilers:

use File::stat;
my $stat = File::stat::stat('./perl');
warn eval '-l $stat';
warn eval '-l "./perl"';
Warning: something's wrong at - line 3.
1 at - line 4.

So it seems File::stat *is* buggy, and the test is just not good enough
half the time.  Or the test is wrong.

I think the test is wrong, as -l _ will fail after a stat.  You have to
do lstat for -l _ to work.  Similarly, -l $stat_obj should only return
true if the $stat_obj was returned by File::stat::lstat.  For
File::stat::stat, -l should either return false or die.  Currently it
returns false.  -l _ dies after stat.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About