Skip Menu |

This queue is for tickets about the Email-Fingerprint CPAN distribution.

Report information
The Basics
Id: 122241
Status: resolved
Priority: 0/
Queue: Email-Fingerprint

People
Owner: len.budney [...] gmail.com
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.48
Fixed in: 0.49



Subject: t/eliminate_dups.t fails on some systems
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.
On 2017-06-26 14:54:52, SREZIC wrote: Show quoted text
> 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
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
Hi Jim! Version 0.49 which includes the chmod() commands, is my workaround for the File::Path issue; I was able to reproduce the problem with Email::Fingerprint version 0.48 and found that it was a permissions issue. The test in question takes away permissions and confirms that the module has the correct failure modes. I'm leery of portability concerns with chmod, but the test already uses it to chmod(0) the file as part of the test, so this workaround code shouldn't make the situation any worse. On Tue Jun 27 14:27:53 2017, JKEENAN wrote: Show quoted text
> On Tue Jun 27 13:38:11 2017, SREZIC wrote:
> > 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
Slaven, Thanks for reporting this! I was able to reproduce it, and identified an issue with File::Path and file permissions. For now I added a workaround to the test in which I reset the permissions before calling rmtree() -- that .t already uses chmod() as part of the test.