Skip Menu |

This queue is for tickets about the Socket-Packet CPAN distribution.

Report information
The Basics
Id: 85687
Status: resolved
Priority: 0/
Queue: Socket-Packet

People
Owner: Nobody in particular
Requestors: jquelin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.10



Subject: t/11siocgstamp.t failure
$ /usr/bin/perl Makefile.PL INSTALLDIRS=vendor # running Build.PL --installdirs vendor Created MYMETA.yml and MYMETA.json Creating new 'Build' script for 'Socket-Packet' version '0.09' $ make -j24 /usr/bin/perl5.18.0 Build --makefile_env_macros 1 Building Socket-Packet gcc -I/usr/lib/perl5/5.18.0/i386-linux-thread-multi/CORE -DVERSION="0.09" -DXS_VERSION="0.09" -fPIC -DHAVE_ORIGDEV -DHAVE_TPACKET -DHAVE_TPACKET2 -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread -o lib/Socket/Packet.o lib/Socket/Packet.c ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Socket/Packet/Packet.bs') gcc -shared -O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables -Wl,--as-needed -Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags -pthread -L/usr/local/lib -o blib/arch/auto/Socket/Packet/Packet.so lib/Socket/Packet.o $ make -j24 test /usr/bin/perl5.18.0 Build --makefile_env_macros 1 test t/00use.t ............................ ok t/01constant.t ....................... ok t/10sockaddr.t ....................... ok # Failed test 'siocgstamp(STDIN) errors EINVAL' # at t/11siocgstamp.t line 23. # got: '25' # expected: '22' # Looks like you failed 1 test of 4. t/11siocgstamp.t ..................... Dubious, test returned 1 (wstat 256, 0x100) Failed 1/4 subtests t/12siocgifindex.t ................... ok t/13recv_len.t ....................... ok t/20io-socket-packet.t ............... skipped: Cannot create PF_PACKET socket t/21io-socket-packet-ifindex2name.t .. ok t/99pod.t ............................ skipped: Test::Pod 1.00 required for testing POD Test Summary Report ------------------- t/11siocgstamp.t (Wstat: 256 Tests: 4 Failed: 1) Failed test: 2 Non-zero exit status: 1 Files=9, Tests=24, 0 wallclock secs ( 0.04 usr 0.00 sys + 0.24 cusr 0.01 csys = 0.29 CPU) Result: FAIL Failed 1/9 test programs. 1/24 subtests failed. make: *** [test] Error 255 error: Bad exit status from /home/iurt/rpmbuild/tmp/rpm-tmp.PcIooc (%check) perl 5.18.0 on Mageia.
Could be a kernel bug, this happens when building for i586 on a x86_64 kernel but works fine when building for x86_64. I would blame compat ioctl.
Could be a kernel bug, this happens when building for i586 on a x86_64 kernel but works fine when building for x86_64. I would blame compat ioctl.
On Wed May 29 03:29:03 2013, JQUELIN wrote: Show quoted text
> # Failed test 'siocgstamp(STDIN) errors EINVAL' > # at t/11siocgstamp.t line 23. > # got: '25' > # expected: '22' > # Looks like you failed 1 test of 4.
22 == EINVAL (generally invalid) 25 == ENOTTY (Inappropriate ioctl for device) Actually it could be argued either of those are equally valid errors in this case. Perhaps I'll allow either from the unit test. -- Paul Evans
On Mon Jan 06 11:16:58 2014, PEVANS wrote: Show quoted text
> Actually it could be argued either of those are equally valid errors > in this case. Perhaps I'll allow either from the unit test.
Patch attached; will release as 0.10. -- Paul Evans
Subject: rt-85687.patch
=== modified file 't/11siocgstamp.t' --- t/11siocgstamp.t 2009-11-10 20:30:55 +0000 +++ t/11siocgstamp.t 2014-01-06 17:10:32 +0000 @@ -6,7 +6,7 @@ use Socket::Packet qw( siocgstamp ); use IO::Socket::INET; -use POSIX qw( EINVAL ENOENT ); +use POSIX qw( EINVAL ENOENT ENOTTY ); # Without actually running as root and capturing a packet we can't really # obtain a valid timestamp. But we can at least check the function exists and @@ -20,7 +20,9 @@ $stamp = siocgstamp( $p1 ); $errno = $!+0; is( $stamp, undef, 'siocgstamp(STDIN) fails' ); -is( $errno, EINVAL, 'siocgstamp(STDIN) errors EINVAL' ); +# Systems vary - sometimes we get EINVAL, sometimes we get ENOTTY +ok( $errno == EINVAL || $errno == ENOTTY, 'siocgstamp(STDIN) errors EINVAL or ENOTTY' ) + or diag( sprintf " Expected %d or %d; got %d", EINVAL, ENOTTY, $errno ); my $sock = IO::Socket::INET->new( LocalPort => 0 );
Thanks I confirmed the kernel behaviour in Ruby: x86_64 system: irb(main):001:0> File.new("/dev/stdin").ioctl(0x8906) Errno::EINVAL: Invalid argument - /dev/stdin i586 chroot: irb(main):001:0> File.new("/dev/stdin").ioctl(0x8906) Errno::ENOTTY: Inappropriate ioctl for device - /dev/stdin
Now released in 0.10. -- Paul Evans