On Tue Jun 27 13:38:11 2017, SREZIC wrote:
Show quoted text> On 2017-06-26 14:54:52, SREZIC wrote:
> > On some of my smokers I see the following failure:
> >
> > ...
> > Subroutine main::trap redefined at
> > /usr/perl5.22.0p/lib/site_perl/5.22.0/Test/Trap.pm line 40.
> > cannot chdir to child for t/data/tmp: Permission denied at
> > t/eliminate_dups.pl line 138.
> > t/eliminate_dups.pl did not return a true value at t/eliminate_dups.t
> > line 18.
> > # Looks like your test exited with 13 just after 62.
> > t/eliminate_dups.t ..
> > Dubious, test returned 13 (wstat 3328, 0xd00)
> > All 62 subtests passed
> > ...
> >
> > Unfortunately I don't see a clear fail/pass pattern here. It could
> > depend on the File::Path version installed; it's more likely to fail
> > if newer File::Path (>= 2.13) is installed.
> >
> > Anyway, maybe it would be better to use File::Temp's tempdir()
> > function in t/eliminate_dups.pl instead of creating and removing the
> > temporary directory yourself.
>
> Maybe a File-Path regression. See
>
https://rt.cpan.org/Ticket/Display.html?id=122255
I installed Perl 5 blead at a recent commit:
#####
$ ./bin/perl -v | head -2 | tail -1
This is perl 5, version 27, subversion 2 (v5.27.2 (v5.27.1-77-g571ee10)) built for x86_64-linux
#####
... which already incorporates recent changes to File::Path:
#####
$ ./bin/perl -Ilib -MFile::Path -E 'say $File::Path::VERSION;'
2.14
#####
I then installed 'cpanm' against that perl and used 'cpanm' to try to install Email::Fingerprint. That installation was successful.
#####
$ ./bin/cpanm Email::Fingerprint
....
Building and testing Email-Fingerprint-0.47 ... OK
Successfully installed Email-Fingerprint-0.47
12 distributions installed
#####
So I was unable to reproduce the bug reported.
That being said, I can understand why Slaven might see this only intermittently and why he recommends use of File::Temp::tempdir(). Let's look at the relevant part of t/eliminate_dups.t:
#####
136 # Restore permissions before deleting stuff
137 chmod (0777, $tmp);
138 chmod (0666, $_) for glob("$tmp/*");
139
#####
The 'chmod' on line 138 is a red flag. It's quite possible that, up until now, t/eliminate_dups.t PASSed because it was relying on an undocumented and potentially unsafe instance of 'chmod'. Recent revisions to File-Path for security purposes (see
https://rt.cpan.org/Ticket/Display.html?id=121951) entailed restrictions on File::Path::rmtree's internal use of chmod.
Given the importance of the security fixes we had to implement, I expect that there will be certain cases where rmtree() will show a regression failure that we will be unable to correct. But judicious use of tempdir() can probably sidestep these failures in testing situations like this.
Thank you very much.
Jim Keenan