Bug#543761: Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
-=| Paul Fenwick, Fri, Sep 04, 2009 at 07:06:02AM +1000 |=- The attached patch fixes the autodie 2.06_01 test suite for me on hppa without breaking it on amd64 :) Hope you can use it at least as a starting point. Thank-you very much for this! Sorry for the slow response, I've applied this as 037738e11a6097734b0e1dabdd77b92e5fe35219 to autodie, which will appear in the next release on the CPAN and also make its way into the Perl core. If you need a new release pushed to the CPAN soon, let me know and I'll make it happen. No hurry, at least for Debian. We have applied the same patch to libautodie-perl (http://bugs.debian.org/543761). Of course, other distributions and direct CPAN users would benefit from a CPAN release :) -- dam signature.asc Description: Digital signature
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Niko Tyni wrote: The attached patch fixes the autodie 2.06_01 test suite for me on hppa without breaking it on amd64 :) Hope you can use it at least as a starting point. Thank-you very much for this! Sorry for the slow response, I've applied this as 037738e11a6097734b0e1dabdd77b92e5fe35219 to autodie, which will appear in the next release on the CPAN and also make its way into the Perl core. If you need a new release pushed to the CPAN soon, let me know and I'll make it happen. All the very best, Paul - -- Paul Fenwick p...@perltraining.com.au | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia| Fax: +61 3 9354 2681 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqgL6gACgkQx5N6j7FHnlUv/QCcDIy8gdoAtMqca9E6tzYNskMp P/wAnA8SaErBbPIH9kaDIg/cTFfmehHX =tq7J -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Processed: Re: Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
Processing commands for cont...@bugs.debian.org: tag 543731 patch Bug #543731 [perl] perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails Added tag(s) patch. thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
tag 543731 patch thanks On Thu, Aug 27, 2009 at 05:39:34PM +1000, Paul Fenwick wrote: Niko Tyni wrote: The problem is that errno.h has separate values for EAGAIN (11) and EWOULDBLOCK (246) on hppa and the kernel is returning EAGAIN (contrary to the flock(2) manual page.) Some background for this can be found in I suppose that regardless of whether this is ever fixed on the kernel and/or documentation side, t/flock.t and lib/Fatal.pm need to check for both EWOULDBLOCK and EAGAIN for compatibility. Drat. EAGAIN actually makes me feel funny, because I've always interpreted it to mean I got distracted there, please try that again. However in this case, we *don't* want to try again, because we'll spin the CPU trying to get a lock in non-blocking mode. So ideally I'd only want to check for EAGAIN on hppa architectures. That should be easy enough for me to detect at compile-time, however I don't have a PA-RISC box handy to see how they identify themselves. The attached patch fixes the autodie 2.06_01 test suite for me on hppa without breaking it on amd64 :) Hope you can use it at least as a starting point. (dropped p5p for now) Cheers, -- Niko Tyni nt...@debian.org From 00960c2d7b761522c06e3b4e1418019ebad2681b Mon Sep 17 00:00:00 2001 From: Niko Tyni nt...@debian.org Date: Sun, 30 Aug 2009 13:58:35 +0300 Subject: [PATCH] Allow for flock returning EAGAIN instead of EWOULDBLOCK on linux/parisc Contrary to the documentation, flock(2) returns EAGAIN instead of EWOULDBLOCK on the Linux parisc port (aka. hppa). http://bugs.debian.org/543731 --- lib/Fatal.pm | 14 +- t/flock.t| 12 ++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/lib/Fatal.pm b/lib/Fatal.pm index 18e71ed..c17a257 100755 --- a/lib/Fatal.pm +++ b/lib/Fatal.pm @@ -5,6 +5,7 @@ use Carp; use strict; use warnings; use Tie::RefHash; # To cache subroutine refs +use Config; use constant PERL510 = ( $] = 5.010 ); @@ -52,6 +53,10 @@ our %_EWOULDBLOCK = ( MSWin32 = 33, ); +# the linux parisc port has separate EAGAIN and EWOULDBLOCK, +# and the kernel returns EAGAIN +my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0; + # We have some tags that can be passed in for use with import. # These are all assumed to be CORE:: @@ -720,6 +725,11 @@ sub _one_invocation { my $EWOULDBLOCK = eval { POSIX::EWOULDBLOCK(); } || $_EWOULDBLOCK{$^O} || _autocroak(Internal error - can't overload flock - EWOULDBLOCK not defined on this system.); +my $EAGAIN = $EWOULDBLOCK; +if ($try_EAGAIN) { +$EAGAIN = eval { POSIX::EAGAIN(); } + || _autocroak(Internal error - can't overload flock - EAGAIN not defined on this system.); +} require Fcntl; # For Fcntl::LOCK_NB @@ -735,7 +745,9 @@ sub _one_invocation { # If we failed, but we're using LOCK_NB and # returned EWOULDBLOCK, it's not a real error. -if (\$_[1] Fcntl::LOCK_NB() and \$! == $EWOULDBLOCK ) { +if (\$_[1] Fcntl::LOCK_NB() and +(\$! == $EWOULDBLOCK or +($try_EAGAIN and \$! == $EAGAIN ))) { return \$retval; } diff --git a/t/flock.t b/t/flock.t index a7550ba..6421a56 100755 --- a/t/flock.t +++ b/t/flock.t @@ -2,7 +2,8 @@ use strict; use Test::More; use Fcntl qw(:flock); -use POSIX qw(EWOULDBLOCK); +use POSIX qw(EWOULDBLOCK EAGAIN); +use Config; require Fatal; @@ -10,6 +11,9 @@ my $EWOULDBLOCK = eval { EWOULDBLOCK() } || $Fatal::_EWOULDBLOCK{$^O} || plan skip_all = EWOULDBLOCK not defined on this system; +my $try_EAGAIN = ($^O eq 'linux' and $Config{archname} =~ /hppa|parisc/) ? 1 : 0; +my $EAGAIN = eval { EAGAIN() }; + my ($self_fh, $self_fh2); eval { @@ -55,7 +59,11 @@ eval { $return = flock($self_fh2, LOCK_EX | LOCK_NB); }; -is($!+0, $EWOULDBLOCK, Double-flocking should be EWOULDBLOCK); +if (!$try_EAGAIN) { +is($!+0, $EWOULDBLOCK, Double-flocking should be EWOULDBLOCK); +} else { +ok($!+0 == $EWOULDBLOCK || $!+0 == $EAGAIN, Double-flocking should be EWOULDBLOCK or EAGAIN); +} ok(!$return, flocking a file twice should fail); is($@, , Non-blocking flock should not fail on EWOULDBLOCK); -- 1.5.6.5
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 G'day Niko / All, Niko Tyni wrote: The problem is that errno.h has separate values for EAGAIN (11) and EWOULDBLOCK (246) on hppa and the kernel is returning EAGAIN (contrary to the flock(2) manual page.) Some background for this can be found in I suppose that regardless of whether this is ever fixed on the kernel and/or documentation side, t/flock.t and lib/Fatal.pm need to check for both EWOULDBLOCK and EAGAIN for compatibility. Drat. EAGAIN actually makes me feel funny, because I've always interpreted it to mean I got distracted there, please try that again. However in this case, we *don't* want to try again, because we'll spin the CPU trying to get a lock in non-blocking mode. So ideally I'd only want to check for EAGAIN on hppa architectures. That should be easy enough for me to detect at compile-time, however I don't have a PA-RISC box handy to see how they identify themselves. If you do have one, could you give the output of: perl -MConfig -le'print $Config{archanme}' I'm sorry we didn't find out about this quite in time before the 5.10.1 release... Well, I'm still glad we've got a test that picked this up. I'm sure it will save someone the pain of tracking down a very subtle bug in the future. Autodie is a dual-life module, so I can push a new version to the CPAN relatively quickly. Many thanks for the bug report! Paul - -- Paul Fenwick p...@perltraining.com.au | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia| Fax: +61 3 9354 2681 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkqWOC4ACgkQx5N6j7FHnlWraACdGx5GXnQa5Q8pFJLEiStUPTpI h/gAniM2QcKX57/JIdeu/MPOW8uCR8UR =6HPz -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
2009/8/27 Paul Fenwick p...@perltraining.com.au: So ideally I'd only want to check for EAGAIN on hppa architectures. That should be easy enough for me to detect at compile-time, however I don't have a PA-RISC box handy to see how they identify themselves. If you do have one, could you give the output of: perl -MConfig -le'print $Config{archanme}' actually that's archname (and can be written more tersely as perl -V:archname) Also, archname will contain other information (e.g. whether the perl has support for threads or not) so you need to test against the first component, which on Linux corresponds to the output of uname -m. -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
On Thu, Aug 27, 2009 at 10:33:22AM +0200, Rafael Garcia-Suarez wrote: 2009/8/27 Paul Fenwick p...@perltraining.com.au: So ideally I'd only want to check for EAGAIN on hppa architectures. That should be easy enough for me to detect at compile-time, however I don't have a PA-RISC box handy to see how they identify themselves. If you do have one, could you give the output of: perl -MConfig -le'print $Config{archanme}' actually that's archname (and can be written more tersely as perl -V:archname) Also, archname will contain other information (e.g. whether the perl has support for threads or not) so you need to test against the first component, which on Linux corresponds to the output of uname -m. Our build calls Configure with -Darchname=hppa-linux-gnu (the output of $(dpkg-architecture -qDEB_BUILD_GNU_TYPE)), resulting in % perl -V:archname archname='hppa-linux-gnu-thread-multi'; % uname -m parisc64 -- Niko Tyni nt...@debian.org -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
Package: perl Version: 5.10.1~rc2-1 Severity: serious Hi, your package failed to build from source. | Automatic build of perl_5.10.1~rc2-1 on meitner by sbuild/hppa 98-farm | Build started at 20090826-1736 | ** | Checking available source versions... | Fetching source files... | Reading package lists... | Building dependency tree... | Reading state information... | Need to get 14.2MB of source archives. | Get:1 http://ftp2.de.debian.org experimental/main perl 5.10.1~rc2-1 (dsc) [1399B] | Get:2 http://ftp2.de.debian.org experimental/main perl 5.10.1~rc2-1 (tar) [14.1MB] | Get:3 http://ftp2.de.debian.org experimental/main perl 5.10.1~rc2-1 (diff) [86.1kB] | Fetched 14.2MB in 24s (576kB/s) | Download complete and in download only mode | ** Using build dependencies supplied by package: | Build-Depends: file, cpio (= 2.6-5), libdb4.7-dev, libgdbm-dev, netbase [!hurd-i386], gcc (= 4:4.2), procps | hurd, zlib1g-dev | libz-dev, libbz2-dev | Build-Conflicts: libterm-readline-gnu-perl ( 1.17) | Checking for already installed source dependencies... [...] | lib/autodie/t/flock...# Failed test 'Double-flocking should be EWOULDBLOCK' | # at ../lib/autodie/t/flock.t line 58. | # got: '11' | # expected: '246' | FAILED at test 2 Full build log(s): http://experimental.ftbfs.de/build.php?ver=5.10.1~rc2-1pkg=perlarch=hppa Gruesse, -- Frank Lichtenheld dj...@debian.org www: http://www.djpig.de/ -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Processed: Re: Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
Processing commands for cont...@bugs.debian.org: clone 543731 -1 Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails Bug 543731 cloned as bug 543761. reassign -1 libautodie-perl 2.06-1 Bug #543761 [perl] perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails Bug reassigned from package 'perl' to 'libautodie-perl'. Bug No longer marked as found in versions perl/5.10.1~rc2-1. Bug #543761 [libautodie-perl] perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails Bug Marked as found in versions libautodie-perl/2.06-1. retitle -1 libautodie-perl: FTBFS on hppa: lib/autodie/t/flock fails Bug #543761 [libautodie-perl] perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails Changed Bug title to 'libautodie-perl: FTBFS on hppa: lib/autodie/t/flock fails' from 'perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails' thanks Stopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database) -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#543731: perl_5.10.1~rc2-1(hppa/experimental): FTBFS: Test lib/autodie/t/flock fails
clone 543731 -1 reassign -1 libautodie-perl 2.06-1 retitle -1 libautodie-perl: FTBFS on hppa: lib/autodie/t/flock fails thanks On Wed, Aug 26, 2009 at 06:44:55PM +0200, Frank Lichtenheld wrote: Package: perl Version: 5.10.1~rc2-1 Severity: serious | lib/autodie/t/flock...# Failed test 'Double-flocking should be EWOULDBLOCK' | # at ../lib/autodie/t/flock.t line 58. | # got: '11' | # expected: '246' | FAILED at test 2 Thanks for the report. This also happens with the separate libautodie-perl package and Perl 5.10.0 so cloning. ok 1 - Test file locked not ok 2 - Double-flocking should be EWOULDBLOCK # Failed test 'Double-flocking should be EWOULDBLOCK' # at t/flock.t line 58. # got: '11' # expected: '246' ok 3 - flocking a file twice should fail not ok 4 - Non-blocking flock should not fail on EWOULDBLOCK # Failed test 'Non-blocking flock should not fail on EWOULDBLOCK' # at t/flock.t line 60. # got: 'Can't lock filehandle for exclusive access: Resource temporarily unavailable at t/flock.t line 55 # ' # expected: '' 1..4 # Looks like you failed 2 tests of 4. The problem is that errno.h has separate values for EAGAIN (11) and EWOULDBLOCK (246) on hppa and the kernel is returning EAGAIN (contrary to the flock(2) manual page.) Some background for this can be found in http://bugs.debian.org/165881 http://lists.parisc-linux.org/hypermail/parisc-linux/9895.html I suppose that regardless of whether this is ever fixed on the kernel and/or documentation side, t/flock.t and lib/Fatal.pm need to check for both EWOULDBLOCK and EAGAIN for compatibility. Cc'ing the upstream author, Paul Fenwick. Paul: just for clarification, hppa is the Debian name for the PA-RISC Linux port. Let me know if you want me to file an RT ticket too. I'm sorry we didn't find out about this quite in time before the 5.10.1 release... -- Niko Tyni nt...@debian.org -- To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org