Skip Menu |

This queue is for tickets about the IO-Async CPAN distribution.

Report information
The Basics
Id: 65127
Status: resolved
Priority: 0/
Queue: IO-Async

People
Owner: Nobody in particular
Requestors: nonsolosoft [...] diff.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.37
Fixed in: 0.40



Subject: Fails test on dragonflybsd 2.9
Test Summary Report ------------------- t/37loop-child-root.t (Wstat: 256 Tests: 5 Failed: 1) Failed test: 5 Non-zero exit status: 1 Files=52, Tests=1268, 83 wallclock secs ( 0.54 usr 0.28 sys + 12.41 cusr 3.09 csys = 16.31 CPU) Result: FAIL Failed 1/52 test programs. 1/1268 subtests failed. PEVANS/IO-Async-0.37.tar.gz ./Build test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports PEVANS/IO-Async-0.37.tar.gz Running Build install make test had returned bad status, won't install without force Failed during this command: PEVANS/IO-Async-0.37.tar.gz : make_test NO lap# perl -Ilib -Iblib t/37loop-child-root.t 1..5 ok 1 - am root ok 2 - setuid ok 3 - setgid ok 4 - setgroups not ok 5 - combined setuid/gid/groups # Failed test 'combined setuid/gid/groups' # at t/37loop-child-root.t line 84. # got: 'EUID: 20 # EGID: 10 # Groups: 5 6 10 10 # ' # expected: 'EUID: 20 # EGID: 10 # Groups: 4 5 6 10 # ' # Looks like you failed 1 test of 5. lap# pwd /tmp/.cpan/build/IO-Async-0.37-K5q1Ew lap# uname -a DragonFly lap.diff.org 2.9-DEVELOPMENT DragonFly v2.9.1.72.g7c47e-DEVELOPMENT #0: Sat Nov 20 16:29:48 CET 2010 ferz@lap.diff.org:/dati/obj/usr/src/sys/GENERIC i386 lap# perl -V Summary of my perl5 (revision 5 version 12 subversion 2) configuration: Platform: osname=dragonfly, osvers=2.9-development, archname=i386-dragonfly-thread-multi uname='dragonfly avalon.theshell.com 2.9-development dragonfly v2.9.0.19.g24872-development #21: thu oct 21 01:25:00 utc 2010 dillon@avalon.theshell.com:usrobjusrsrcsysavalon i386 ' config_args='-sde -Duseshrplib -Duseithreads -Uusemymalloc' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector', optimize='-O2 -pthread -I/usr/include', cppflags='-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -fstack-protector' ccversion='', gccversion='4.1.2 (DragonFly)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags ='-Wl,-R/usr/pkg/lib -pthread -Wl,-E -fstack-protector' libpth=/usr/lib libs=-lm -lcrypt -lpthread -lrt perllibs=-lm -lcrypt -lpthread -lrt libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -Wl,-R/usr/pkg/lib/perl5/5.12.0/i386-dragonfly-thread-multi/CORE' cccdlflags='-DPIC -fPIC', lddlflags='-Wl,-R/usr/pkg/lib -shared -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under dragonfly Compiled at Oct 21 2010 03:31:25 @INC: /usr/pkg/lib/perl5/site_perl/5.12.0/i386-dragonfly-thread-multi /usr/pkg/lib/perl5/site_perl/5.12.0 /usr/pkg/lib/perl5/vendor_perl/5.12.0/i386-dragonfly-thread-multi /usr/pkg/lib/perl5/vendor_perl/5.12.0 /usr/pkg/lib/perl5/5.12.0/i386-dragonfly-thread-multi /usr/pkg/lib/perl5/5.12.0 .
On Tue Jan 25 17:16:46 2011, nonsolosoft@diff.org wrote: Show quoted text
> not ok 5 - combined setuid/gid/groups > # Failed test 'combined setuid/gid/groups' > # at t/37loop-child-root.t line 84. > # got: 'EUID: 20 > # EGID: 10 > # Groups: 5 6 10 10 > # ' > # expected: 'EUID: 20 > # EGID: 10 > # Groups: 4 5 6 10 > # '
Hmmm... That test basically tests the ability to perform the following: # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' 10 4 5 6 10 Could you try that directly, and see what the output gives? Perhaps it's a difference in the way Dragonfly implements setgid/setgroups. -- Paul Evans
Subject: Re: [rt.cpan.org #65127] Fails test on dragonflybsd 2.9
Date: Fri, 11 Feb 2011 16:01:30 +0100
To: bug-IO-Async [...] rt.cpan.org
From: Ferruccio Zamuner <nonsolosoft [...] diff.org>
On 02/11/11 00:04, Paul Evans via RT wrote: Show quoted text
Show quoted text
> Hmmm... > > That test basically tests the ability to perform the following: > > # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' > 10 4 5 6 10 > > Could you try that directly, and see what the output gives? Perhaps it's > a difference in the way Dragonfly implements setgid/setgroups. >
Sure: on DragonFlyBSD 2.9.1 Show quoted text
> perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)'
1002 1002 0 5 on FreeBSD 8.1 Show quoted text
> perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)'
1002 1002 0 65532 on Debian: ferz@cluster:~$ uname -a Linux cluster 2.6.26-2-686 #1 SMP Mon Jun 21 05:58:44 UTC 2010 i686 GNU/Linux ferz@cluster:~$ perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' 1009 1009 I'm here for more investigation. Bye, \ferz
On Fri Feb 11 10:01:52 2011, nonsolosoft@diff.org wrote: Show quoted text
> > # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' > > 10 4 5 6 10
Perhaps this was too subtle - the # prompt means you'll have to be root. Only root can setgid/setgroups. Show quoted text
> on DragonFlyBSD 2.9.1
> > perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)'
> 1002 1002 0 5
... These are just your normal non-root account failing to be able to setgroups, so returning the old value. Please retry as root. -- Paul Evans
Subject: Re: [rt.cpan.org #65127] Fails test on dragonflybsd 2.9
Date: Fri, 11 Feb 2011 16:20:12 +0100
To: bug-IO-Async [...] rt.cpan.org
From: Ferruccio Zamuner <nonsolosoft [...] diff.org>
On 02/11/11 16:09, Paul Evans via RT wrote: Show quoted text
Show quoted text
> Perhaps this was too subtle - the # prompt means you'll have to be root.
Show quoted text
> These are just your normal non-root account failing to be able to > setgroups, so returning the old value. Please retry as root. >
lap# perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' 10 10 5 6 10 lap# uname -a DragonFly lap 2.9-DEVELOPMENT DragonFly v2.9.1.573.g1b505-DEVELOPMENT #1: Sun Jan 30 20:46:22 CET 2011 fer@lap:/dati/obj/mnt2/usr/src/sys/GENERIC i386 u1# perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' 10 10 5 6 10 u1# uname -a FreeBSD u1 8.1-RELEASE FreeBSD 8.1-RELEASE #3: Sun Jul 18 11:40:02 UTC 2010 ferz@u1:/usr/obj/usr/src/sys/NONSOLOSOFT8 amd64 Thank you in advance, \ferz
On Fri Feb 11 10:20:33 2011, nonsolosoft@diff.org wrote: Show quoted text
> u1# perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' > 10 10 5 6 10 > u1# uname -a > FreeBSD u1 8.1-RELEASE FreeBSD 8.1-RELEASE #3: Sun Jul 18 11:40:02 UTC > 2010 ferz@u1:/usr/obj/usr/src/sys/NONSOLOSOFT8 amd64 > > > Thank you in advance, \ferz
On further investigation, it appears that DragonflyBSD is ignoring the first element of the setgroups(2) list, presuming it to be the primary GID. Try instead # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 10 4 5 6"; say $)' Presuming that to be the case, it should correctly print the entire set of GIDs (though I can't say offhand what order they might arrive in...) I'll prepare a patch to ChildManager to shuffle the primary GID into the first position of the list, so this test should work. In the meantime, if you need to install it, you can notest install IO::Async presuming this is the only test that fails. The rest of the modules appear to be working fine, it's just that you won't be able to correctly use the 'setgroups' feature of the ChildManager. -- Paul Evans
Subject: Re: [rt.cpan.org #65127] Fails test on dragonflybsd 2.9
Date: Tue, 15 Feb 2011 11:00:28 +0100
To: bug-IO-Async [...] rt.cpan.org
From: Ferruccio Zamuner <nonsolosoft [...] diff.org>
On 02/14/11 18:26, Paul Evans via RT wrote: Show quoted text
> On further investigation, it appears that DragonflyBSD is ignoring the > first element of the setgroups(2) list, presuming it to be the primary > GID. Try instead > > # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 10 4 5 6"; say $)' > > Presuming that to be the case, it should correctly print the entire set > of GIDs (though I can't say offhand what order they might arrive in...) >
Ok, I've tested both on FreeBSD 8.1 and on DragonFlyBSD 2.9 with same results. # perl -E '$) = 10; my $gid = $)+0; $) = "$gid 4 5 6 10"; say $)' 10 10 5 6 10 Show quoted text
> I'll prepare a patch to ChildManager to shuffle the primary GID into the > first position of the list, so this test should work.
Thank you, \ferz
On Tue Feb 15 05:00:56 2011, nonsolosoft@diff.org wrote: Show quoted text
> > I'll prepare a patch to ChildManager to shuffle the primary GID into the > > first position of the list, so this test should work.
> > Thank you, \ferz
See how you get on with the-attached. -- Paul Evans
Subject: rt65127.patch
=== modified file 'lib/IO/Async/ChildManager.pm' --- lib/IO/Async/ChildManager.pm 2011-02-10 23:30:56 +0000 +++ lib/IO/Async/ChildManager.pm 2011-02-16 22:25:48 +0000 @@ -342,7 +342,8 @@ this is the case. If setting both the primary GID and the supplementary groups list, it is -suggested to set the primary GID first. +suggested to set the primary GID first. Moreover, some operating systems may +require that the supplementary groups list contains the primary GID. =back @@ -613,8 +614,13 @@ } elsif( $key eq "setgroups" ) { my $gid = $)+0; - my $groups = join( " ", @$value ); - $) = "$gid $groups" or die "Cannot setgroups('$groups') - $!"; + # Put the primary GID as the first group in the supplementary + # list, because some operating systems ignore this position, + # expecting it to indeed be the primary GID. + # See + # https://rt.cpan.org/Ticket/Display.html?id=65127 + my $groups = join( " ", grep { $_ != $gid } @$value ); + $) = "$gid $gid $groups" or die "Cannot setgroups('$groups') - $!"; } } }
Subject: Re: [rt.cpan.org #65127] Fails test on dragonflybsd 2.9
Date: Thu, 17 Feb 2011 00:39:25 +0100
To: bug-IO-Async [...] rt.cpan.org
From: Ferruccio Zamuner <nonsolosoft [...] diff.org>
On 02/16/11 23:30, Paul Evans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65127> >
>>> I'll prepare a patch to ChildManager to shuffle the primary GID into the >>> first position of the list, so this test should work.
> > See how you get on with the-attached. >
Yes, it fix. Thank you. On same package: lap# perl -Ilib t/52loop-listen.t 1..17 ok 1 - on_notifier fired synchronously ok 2 - synchronous on_notifier given a Notifier isa IO::Async::Notifier ok 3 - $clientsock is connected ok 4 - $newclient peer is correct ok 5 - $listensock has a fileno ok 6 - $listenaddr isa IO::Socket::INET isa IO::Socket::INET ok 7 - on_notifier fired asynchronously ok 8 - asynchronous on_notifier given a Notifier isa IO::Async::Notifier ok 9 - $listensock has address ok 10 - $listenaddr is INADDR_LOOPBACK ok 11 - $clientsock on the correct port ok 12 - $newclient isa IO::Socket::INET isa IO::Socket::INET ok 13 - $newclient peer is correct Test died early - listen on port 22 actually succeeded # Looks like you planned 17 tests but ran 13. # Looks like your test exited with 29 just after 13. I hope to not bore you. Bye, \ferz
On Wed Feb 16 18:39:51 2011, nonsolosoft@diff.org wrote: Show quoted text
> On same package: >
... Show quoted text
> Test died early - listen on port 22 actually succeeded > # Looks like you planned 17 tests but ran 13. > # Looks like your test exited with 29 just after 13.
Ah yes, I had noticed that on a few of the smokers. I wonder if it's related to some jail-like virtualisation of network stack, or somesuch. In any case, see if the attached patch fixes it. -- Paul Evans
Subject: rt65127-2.patch
=== modified file 't/52loop-listen.t' --- t/52loop-listen.t 2011-03-02 18:15:32 +0000 +++ t/52loop-listen.t 2011-03-02 18:22:02 +0000 @@ -124,7 +124,12 @@ my $badport; my $failure; foreach my $port ( 22, 80 ) { - IO::Socket::INET->new( Type => SOCK_STREAM, LocalPort => $port, Listen => 1, ReuseAddr => 1 ) and next; + IO::Socket::INET->new( + Type => SOCK_STREAM, + LocalHost => "localhost", + LocalPort => $port, + Listen => 1, + ) and next; $badport = $port; $failure = $!; @@ -142,6 +147,7 @@ $loop->listen( family => "inet", socktype => "stream", + host => "localhost", service => $badport, on_resolve_error => sub { die "Test died early - resolve error $_[0]\n"; },
Subject: Re: [rt.cpan.org #65127] Fails test on dragonflybsd 2.9
Date: Thu, 03 Mar 2011 00:21:43 +0100
To: bug-IO-Async [...] rt.cpan.org
From: Ferruccio Zamuner <nonsolosoft [...] diff.org>
On 03/02/11 19:36, Paul Evans via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=65127> >
>> Test died early - listen on port 22 actually succeeded >> # Looks like you planned 17 tests but ran 13. >> # Looks like your test exited with 29 just after 13.
> > In any case, see if the attached patch fixes it. >
Yes, it works. Thank you. \ferz
On Wed Mar 02 18:22:03 2011, nonsolosoft@diff.org wrote: Show quoted text
> Yes, it works.
OK. This will be in 0.40 then. -- Paul Evans