Skip Menu |
 

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

Report information
The Basics
Id: 92403
Status: resolved
Priority: 0/
Queue: IO-Socket-SSL

People
Owner: Steffen_Ullrich [...] genua.de
Requestors: pause [...] tlinx.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.967
Fixed in: (no value)



Subject: 2 non blocking tests fail (not sure why)
Download (untitled) / with headers
text/plain 8.2k
output of t/nonblock.t: Show quoted text
> perl t/nonblock.t
1..27 ok # [server] Server Initialization # connect in progress ok # [server] tcp accept ok # [client] client tcp connect # wrote 9 bytes ok # [client] write plain text ok # [server] received plain text ok # [client] upgrade client to IO::Socket::SSL # SSL wants a read first ok # [server] upgrade to_client to IO::Socket::SSL # SSL wants a read first ok # [server] ssl accept handshake done ok # [client] connected ok # [client] nonblocking connect with 2 attempts # sndbuf=16384 ok # [server] received client message ok # [client] syswrite not ok # [client] multiple write attempts ok # [client] 30000 bytes send # connect in progress ok # [client] client tcp connect # wrote 9 bytes ok # [client] write plain text # read 30000 (1 r/w attempts) ok # [server] tcp accept ok # [server] received plain text ok # [server] upgrade to_client to IO::Socket::SSL ok # [client] upgrade client to IO::Socket::SSL # SSL wants a read first # SSL wants a read first ok # [server] ssl accept handshake done ok # [server] nonblocking accept_SSL with 2 attempts ok # [client] connected # sndbuf=16384 ok # [server] received client message ok # [client] syswrite not ok # [client] multiple write attempts ok # [client] 30000 bytes send # read 30000 (2 r/w attempts) --------------------- Both "multiple write attempts" tests failed. perl -V Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=linux, osvers=3.12.0-isht-van, archname=x86_64-linux-thread-multi-ld uname='linux ishtar 3.12.0-isht-van #1 smp preempt wed nov 13 16:50:51 pst 2013 x86_64 x86_64 x86_64 gnulinux ' config_args='' hint=previous, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=define usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g -O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8 alignbytes=16, prototype=define Linker and Libraries: ld='gcc', ldflags ='-g -fstack-protector -fPIC' libpth=/usr/lib64 /lib64 libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.18.so, so=so, useshrplib=true, libperl=libperl-5.16.3.so gnulibc_version='2.18' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld/CORE' cccdlflags='-fPIC', lddlflags='-shared -g -O2 -fstack-protector -fPIC' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Jan 22 2014 13:31:33 %ENV: PERL5OPT="-Mutf8 -CSA -I/home/law/bin/lib" @INC: /home/law/bin/lib /home/perl/perl-5.16.3/lib/site/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib/site /home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib . Ishtar:law> unset PERL5OPT Ishtar:law> perl -V Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=linux, osvers=3.12.0-isht-van, archname=x86_64-linux-thread-multi-ld uname='linux ishtar 3.12.0-isht-van #1 smp preempt wed nov 13 16:50:51 pst 2013 x86_64 x86_64 x86_64 gnulinux ' config_args='' hint=previous, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=define usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g -O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8 alignbytes=16, prototype=define Linker and Libraries: ld='gcc', ldflags ='-g -fstack-protector -fPIC' libpth=/usr/lib64 /lib64 libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.18.so, so=so, useshrplib=true, libperl=libperl-5.16.3.so gnulibc_version='2.18' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld/CORE' cccdlflags='-fPIC', lddlflags='-shared -g -O2 -fstack-protector -fPIC' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF Built under linux Compiled at Jan 22 2014 13:31:33 @INC: /home/perl/perl-5.16.3/lib/site/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib/site /home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib . --------------------- (FYI...: Running make test PERL_DL_NONLAZY=1 /home/perl/perl-5.16.3/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01loadmodule.t ........... ok t/acceptSSL-timeout.t ...... ok t/auto_verify_hostname.t ... ok t/cert_no_file.t ........... ok t/compatibility.t .......... ok t/connectSSL-timeout.t ..... ok t/core.t ................... ok t/dhe.t .................... ok t/ecdhe.t .................. ok t/io-socket-inet6.t ........ skipped: no IO::Socket::INET6 available t/io-socket-ip.t ........... skipped: (no reason given) t/memleak_bad_handshake.t .. ok t/mitm.t ................... ok t/nonblock.t ............... Failed 2/27 subtests t/npn.t .................... ok t/readline.t ............... ok t/sessions.t ............... ok t/signal-readline.t ........ ok t/sni.t .................... ok t/start-stopssl.t .......... ok t/startssl-failed.t ........ ok t/startssl.t ............... ok t/sysread_write.t .......... ok t/verify_hostname.t ........ ok Test Summary Report ------------------- t/nonblock.t (Wstat: 0 Tests: 27 Failed: 2) Failed tests: 13, 26 Files=24, Tests=345, 35 wallclock secs ( 0.13 usr 0.05 sys + 3.37 cusr 0.89 csys = 4.44 CPU) Result: FAIL Failed 1/24 test programs. 2/345 subtests failed. make: *** [test_dynamic] Error 255 (/usr/bin/make test exited with 512) ---- Blocks build/install of LWP-Protocol-https-6.04.tar.gz
Download (untitled) / with headers
text/plain 1.5k
According to cpantesters the problem does not happen any longer, so whatever the cause was, it probably vanished. Case closed :) Nevertheless, thanks for reporting. Steffen On Thu Jan 23 01:08:40 2014, LAWALSH wrote: Show quoted text
> output of t/nonblock.t: >
> > perl t/nonblock.t
> 1..27 > ok # [server] Server Initialization > # connect in progress > ok # [server] tcp accept > ok # [client] client tcp connect > # wrote 9 bytes > ok # [client] write plain text > ok # [server] received plain text > ok # [client] upgrade client to IO::Socket::SSL > # SSL wants a read first > ok # [server] upgrade to_client to IO::Socket::SSL > # SSL wants a read first > ok # [server] ssl accept handshake done > ok # [client] connected > ok # [client] nonblocking connect with 2 attempts > # sndbuf=16384 > ok # [server] received client message > ok # [client] syswrite > not ok # [client] multiple write attempts > ok # [client] 30000 bytes send > # connect in progress > ok # [client] client tcp connect > # wrote 9 bytes > ok # [client] write plain text > # read 30000 (1 r/w attempts) > ok # [server] tcp accept > ok # [server] received plain text > ok # [server] upgrade to_client to IO::Socket::SSL > ok # [client] upgrade client to IO::Socket::SSL > # SSL wants a read first > # SSL wants a read first > ok # [server] ssl accept handshake done > ok # [server] nonblocking accept_SSL with 2 attempts > ok # [client] connected > # sndbuf=16384 > ok # [server] received client message > ok # [client] syswrite > not ok # [client] multiple write attempts > ok # [client] 30000 bytes send > # read 30000 (2 r/w attempts) > ...
Download (untitled) / with headers
text/plain 2.5k
On Sun Mar 09 04:13:45 2014, SULLR wrote: Show quoted text
> According to cpantesters the problem does not happen any longer, so > whatever the cause was, it probably vanished. Case closed :) > > Nevertheless, thanks for reporting. > Steffen
------- You might want to check cpan testers again. I just tried to build it with failure in the non-blocking area. V1.967 Running make test PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/01loadmodule.t ........... ok t/acceptSSL-timeout.t ...... ok t/auto_verify_hostname.t ... ok t/cert_no_file.t ........... ok t/compatibility.t .......... ok t/connectSSL-timeout.t ..... ok t/core.t ................... ok t/dhe.t .................... ok t/ecdhe.t .................. ok t/io-socket-inet6.t ........ skipped: no IO::Socket::INET6 available t/io-socket-ip.t ........... skipped: (no reason given) t/memleak_bad_handshake.t .. ok t/mitm.t ................... ok t/nonblock.t ............... Failed 2/27 subtests t/npn.t .................... ok t/readline.t ............... ok t/sessions.t ............... ok t/signal-readline.t ........ ok t/sni.t .................... ok t/start-stopssl.t .......... ok t/startssl-failed.t ........ ok t/startssl.t ............... ok t/sysread_write.t .......... ok t/verify_fingerprint.t ..... ok t/verify_hostname.t ........ ok Test Summary Report ------------------- t/nonblock.t (Wstat: 0 Tests: 27 Failed: 2) Failed tests: 13, 26 Files=25, Tests=351, 35 wallclock secs ( 0.14 usr 0.05 sys + 3.63 cusr 0.93 csys = 4.75 CPU) Result: FAIL Failed 1/25 test programs. 2/351 subtests failed. make: *** [test_dynamic] Error 255 (/usr/bin/make test exited with 512) CPAN::Reporter: Test result is 'fail', One or more tests failed. CPAN::Reporter: preparing a CPAN Testers report for IO-Socket-SSL-1.967 Do you want to review or edit the test report? (yes/no) [no] Do you want to send the report? (yes/no) [yes] CPAN::Reporter: sending test report with 'fail' via Metabase SULLR/IO-Socket-SSL-1.967.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, try: reports SULLR/IO-Socket-SSL-1.967.tar.gz Running make install make test had returned bad status, won't install without force ------------- CPAN testers are a self-selected group of people who can use and install the SW w/no problems. If there are problems, I don't usually attempt retries so cpan testers wouldn't show any faults...
Download (untitled) / with headers
text/plain 2.9k
My perconfig is slightly different (not that it likely make a difference, but thought I'd include it for completeness sake. Same perl version, different compile options: Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=linux, osvers=3.12.0-isht-van, archname=x86_64-linux-thread-multi-ld uname='linux ishtar 3.12.0-isht-van #1 smp preempt wed nov 13 16:50:51 pst 2013 x86_64 x86_64 x86_64 gnulinux ' config_args='' hint=previous, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=define usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g -O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccversion='', gccversion='4.8.1 20130909 [gcc-4_8-branch revision 202388]', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='long double', nvsize=16, Off_t='off_t', lseeksize=8 alignbytes=16, prototype=define Linker and Libraries: ld='gcc', ldflags ='-g -fstack-protector -fPIC' libpth=/usr/lib64 /lib64 libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.18.so, so=so, useshrplib=true, libperl=libperl-5.16.3.so gnulibc_version='2.18' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E -Wl,-rpath,/home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld/CORE' cccdlflags='-fPIC', lddlflags='-shared -g -O2 -fstack-protector -fPIC' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at Jan 23 2014 00:35:49 @INC: /home/perl/perl-5.16.3/lib/site/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib/site /home/perl/perl-5.16.3/lib/x86_64-linux-thread-multi-ld /home/perl/perl-5.16.3/lib .
Download (untitled) / with headers
text/plain 331b
p.s. sorry to be barer of bad news & re-open this, but given that it was cpantester reports that were giving it a clean bill of health, and I know that's not the case now...I thought it was appropriate? Please don't take offense... If you want me to try a version, would be more than happy, or provide any other info... Cheers!
Download (untitled) / with headers
text/plain 803b
Am So 09. Mär 2014, 22:29:09, LAWALSH schrieb: Show quoted text
> p.s. sorry to be barer of bad news & re-open this, but given that it > was cpantester reports that were giving it a clean bill of health, and > I know that's not the case now...I thought it was appropriate? Please > don't take offense... > > If you want me to try a version, would be more than happy, or provide > any other info...
could you please provide me with more information about you build, especially - version of Net::SSLeay used (newest?) - platform (I see linux, but which distribution, might be important because of libc or libssl used) - build options - perlbrew at least does not build with -thread-ld for me - is this a especially slow or fast machine (e.g. might there be race conditions I don't see on my machine)? Thanks, Steffen
Download (untitled) / with headers
text/plain 853b
Um, I marked the "broken in" field (newest version), and it was at the end of the test output. But to answer your question, it is the newest. I'm running from a OpenSuse13.1 base. Show quoted text
> rpm -qi glibc
Name : glibc Version : 2.18 Release : 4.4.1 Architecture: x86_64 ---- 2 versions of openssl are installed for different programs that need them: - Name : libopenssl0_9_8 Version : 0.9.8x Release : 5.1.3 ---- Other is Name : libopenssl1_0_0 Version : 1.0.1e Release : 11.2.1 --- Has tickless clock of 1000Hz and is running Preemptable. 2x6 cores: model name : Intel Xeon X5660 @ 2.80G cpu MHz : 1596.000 cache size : 12288 KB middle speed was slowest. I don't use perlbrew, I built using configure (attaching config.sh). or is it config_h.SH you would want? --- Did i miss anything? ;-)
Subject: config.sh
Download config.sh
application/x-sh 35.7k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 341b
Hi, I could not reproduce the problem with your config and an OpenSuse13.1 inside a virtual machine. But I've seen strange effects on other systems, where interactions with socket buffers made everything really slow. Could you please run the attached version of nonblock.t which does timings and send me the output or paste it here? Steffen
Subject: nonblock.t
Download nonblock.t
text/x-perl 10.9k
#!perl # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl t/nonblock.t' use strict; use warnings; use Net::SSLeay; use Socket; use IO::Socket::SSL; use IO::Select; use Time::HiRes 'gettimeofday'; use Errno qw( EAGAIN EINPROGRESS EPIPE ECONNRESET ); if ( ! eval "use 5.006; use IO::Select; return 1" ) { print "1..0 # Skipped: no support for nonblocking sockets\n"; exit; } if ( grep { $^O =~m{$_} } qw( MacOS VOS vmesa riscos amigaos ) ) { print "1..0 # Skipped: fork not implemented on this platform\n"; exit } if ( $^O =~m{mswin32}i ) { print "1..0 # Skipped: nonblocking does not work on Win32\n"; exit } $SIG{PIPE} = 'IGNORE'; # use EPIPE not signal handler $|=1; print "1..27\n"; # first create simple non-blocking tcp-server my $ID = 'server'; my $server = IO::Socket::INET->new( Blocking => 0, LocalAddr => '127.0.0.1', LocalPort => 0, Listen => 2, ); my $start = gettimeofday(); print "not ok: $!\n", exit if !$server; # Address in use? ok("Server Initialization"); my $saddr = $server->sockhost.':'.$server->sockport; my $ssock = $server->sockname; defined( my $pid = fork() ) || die $!; if ( $pid == 0 ) { ############################################################ # CLIENT == child process ############################################################ close($server); $ID = 'client'; # fast: try connect_SSL immediately after sending plain text # connect_SSL should fail on the first attempt because server # is not ready yet # slow: wait before calling connect_SSL # connect_SSL should succeed, because server was already waiting for my $test ( 'fast','slow' ) { # initial socket is unconnected, tcp, nonblocking my $to_server = IO::Socket::INET->new( Proto => 'tcp', Blocking => 0 ); # nonblocking connect of tcp socket while (1) { connect($to_server,$ssock ) && last; if ( $!{EINPROGRESS} ) { diag( 'connect in progress' ); IO::Select->new( $to_server )->can_write(30) && next; print "not "; last; } elsif ( $!{EALREADY} ) { diag( 'connect not yet completed'); # just wait select(undef,undef,undef,0.1); next; } elsif ( $!{EISCONN} ) { diag('claims that socket is already connected'); # found on Mac OS X, dunno why it does not tell me that # the connect succeeded before last; } diag( 'connect failed: '.$! ); print "not "; last; } ok( "client tcp connect" ); # work around (older?) systems where IO::Socket::INET # cannot do non-blocking connect by forcing non-blocking # again (we want to test non-blocking behavior of IO::Socket::SSL, # not IO::Socket::INET) $to_server->blocking(0); # send some plain text on non-ssl socket my $pmsg = 'plaintext'; while ( $pmsg ne '' ) { my $w = syswrite( $to_server,$pmsg ); if ( ! defined $w ) { if ( ! $!{EAGAIN} ) { diag("syswrite failed with $!"); print "not "; last; } IO::Select->new($to_server)->can_write(30) or do { diag("failed to get write ready"); print "not "; last; }; } elsif ( $w>0 ) { diag("wrote $w bytes"); substr($pmsg,0,$w,''); } else { die "syswrite returned 0"; } } ok( "write plain text" ); # let server catch up, so that it awaits my connection # so that connect_SSL does not have to wait sleep(5) if ( $test eq 'slow' ); # upgrade to SSL socket w/o connection yet if ( ! IO::Socket::SSL->start_SSL( $to_server, SSL_startHandshake => 0, SSL_verify_mode => 0, SSL_key_file => "certs/server-key.enc", SSL_passwd_cb => sub { return "bluebell" }, )) { diag( 'start_SSL return undef' ); print "not "; } elsif ( !UNIVERSAL::isa( $to_server,'IO::Socket::SSL' ) ) { diag( 'failed to upgrade socket' ); print "not "; } ok( "upgrade client to IO::Socket::SSL" ); # SSL handshake thru connect_SSL # if $test eq 'fast' we expect one failed attempt because server # did not call accept_SSL yet my $attempts = 0; while ( 1 ) { $to_server->connect_SSL && last; diag( $SSL_ERROR ); if ( $SSL_ERROR == SSL_WANT_READ ) { $attempts++; IO::Select->new($to_server)->can_read(30) && next; # retry if can read } elsif ( $SSL_ERROR == SSL_WANT_WRITE ) { IO::Select->new($to_server)->can_write(30) && next; # retry if can write } diag( "failed to connect: $@" ); print "not "; last; } ok( "connected" ); if ( $test ne 'slow' ) { print "not " if !$attempts; ok( "nonblocking connect with $attempts attempts" ); } # send some data # we send up to 500000 bytes, server reads first 10 bytes and then sleeps # before reading more. In total server only reads 30000 bytes # the sleep will cause the internal buffers to fill up so that the syswrite # should return with EAGAIN+SSL_WANT_WRITE. # the socket close should cause EPIPE or ECONNRESET my $msg = "1234567890"; $attempts = 0; my $bytes_send = 0; # set send buffer to 8192 so it will definitely fail writing all 500000 bytes in it # beware that linux allocates twice as much (see tcp(7)) # AIX seems to get very slow if you set the sndbuf on localhost, so don't to it # https://rt.cpan.org/Public/Bug/Display.html?id=72305 if ( $^O !~m/aix/i ) { eval q{ setsockopt( $to_server, SOL_SOCKET, SO_SNDBUF, pack( "I",8192 )); diag( "sndbuf=".unpack( "I",getsockopt( $to_server, SOL_SOCKET, SO_SNDBUF ))); }; } my $test_might_fail; if ( $@ ) { # the next test might fail because setsockopt(... SO_SNDBUF...) failed $test_might_fail = 1; } my $can; WRITE: for( my $i=0;$i<50000;$i++ ) { my $offset = 0; while (1) { if ( $can && ! IO::Select->new($to_server)->$can(30)) { diag("fail $can"); print "not "; last WRITE; }; my $n = syswrite( $to_server,$msg,length($msg)-$offset,$offset ); if ( !defined($n) ) { diag( "\$!=$! \$SSL_ERROR=$SSL_ERROR send=$bytes_send" ); if ( $! == EAGAIN ) { if ( $SSL_ERROR == SSL_WANT_WRITE ) { diag( 'wait for write' ); $can = 'can_write'; $attempts++; } elsif ( $SSL_ERROR == SSL_WANT_READ ) { diag( 'wait for read' ); $can = 'can_read'; } else { $can = 'can_write'; } } elsif ( ( $! == EPIPE || $! == ECONNRESET ) && $bytes_send > 30000 ) { diag( "connection closed hard" ); last WRITE; } else { print "not "; last WRITE; } next; } elsif ( $n == 0 ) { diag( "connection closed" ); last WRITE; } elsif ( $n<0 ) { diag( "syswrite returned $n!" ); print "not "; last WRITE; } $bytes_send += $n; if ( $n + $offset == 10 ) { diag( "write($i) done($n+$offset)" ); last } else { $offset += $n; diag( "partial write of $n new offset=$offset" ); } } } ok( "syswrite" ); if ( ! $attempts && $test_might_fail ) { ok( " write attempts failed, but OK nevertheless because setsockopt failed" ); } else { print "not " if !$attempts; ok( "multiple write attempts" ); } print "not " if $bytes_send < 30000; ok( "30000 bytes send" ); } } else { ############################################################ # SERVER == parent process ############################################################ # pendant to tests in client. Where client is slow (sleep # between plain text sending and connect_SSL) I need to # be fast and where client is fast I need to be slow (sleep # between receiving plain text and accept_SSL) foreach my $test ( 'slow','fast' ) { # accept a connection IO::Select->new( $server )->can_read(30); my $from_client = $server->accept or print "not "; ok( "tcp accept" ); $from_client || do { diag( "failed to tcp accept: $!" ); next; }; # make client non-blocking! $from_client->blocking(0); # read plain text data my $buf = ''; while ( length($buf) <9 ) { sysread( $from_client, $buf,9-length($buf),length($buf) ) && next; die "sysread failed: $!" if $! != EAGAIN; IO::Select->new( $from_client )->can_read(30); } $buf eq 'plaintext' || print "not "; ok( "received plain text" ); # upgrade socket to IO::Socket::SSL # no handshake yet if ( ! IO::Socket::SSL->start_SSL( $from_client, SSL_startHandshake => 0, SSL_server => 1, SSL_verify_mode => 0x00, SSL_ca_file => "certs/test-ca.pem", SSL_use_cert => 1, SSL_cert_file => "certs/client-cert.pem", SSL_key_file => "certs/client-key.enc", SSL_passwd_cb => sub { return "opossum" }, )) { diag( 'start_SSL return undef' ); print "not "; } elsif ( !UNIVERSAL::isa( $from_client,'IO::Socket::SSL' ) ) { diag( 'failed to upgrade socket' ); print "not "; } ok( "upgrade to_client to IO::Socket::SSL" ); sleep(5) if $test eq 'slow'; # wait until client calls connect_SSL # SSL handshake thru accept_SSL # if test is 'fast' (e.g. client is 'slow') we excpect the first # accept_SSL attempt to fail because client did not call connect_SSL yet my $attempts = 0; while ( 1 ) { $from_client->accept_SSL && last; if ( $SSL_ERROR == SSL_WANT_READ ) { $attempts++; IO::Select->new($from_client)->can_read(30) && next; # retry if can read } elsif ( $SSL_ERROR == SSL_WANT_WRITE ) { $attempts++; IO::Select->new($from_client)->can_write(30) && next; # retry if can write } else { diag( "failed to ssl accept ($test): $@" ); print "not "; last; } } ok( "ssl accept handshake done" ); if ( $test eq 'fast' ) { print "not " if !$attempts; ok( "nonblocking accept_SSL with $attempts attempts" ); } # reading 10 bytes # then sleeping so that buffers from client to server gets # filled up and clients receives EAGAIN+SSL_WANT_WRITE IO::Select->new( $from_client )->can_read(30); ( sysread( $from_client, $buf,10 ) == 10 ) || print "not "; #diag($buf); ok( "received client message" ); sleep(5); my $bytes_received = 10; # read up to 30000 bytes from client, then close the socket my $can; READ: while ( ( my $diff = 30000 - $bytes_received ) > 0 ) { if ( $can && ! IO::Select->new($from_client)->$can(30)) { diag("failed $can"); print "not "; last READ; } my $n = sysread( $from_client,my $buf,$diff ); if ( !defined($n) ) { diag( "\$!=$! \$SSL_ERROR=$SSL_ERROR" ); if ( $! == EAGAIN ) { if ( $SSL_ERROR == SSL_WANT_READ ) { $attempts++; $can = 'can_read'; } elsif ( $SSL_ERROR == SSL_WANT_WRITE ) { $attempts++; $can = 'can_write'; } else { $can = 'can_read'; } } else { print "not "; last READ; } next; } elsif ( $n == 0 ) { diag( "connection closed" ); last READ; } elsif ( $n<0 ) { diag( "sysread returned $n!" ); print "not "; last READ; } $bytes_received += $n; #diag( "read of $n bytes total $bytes_received" ); } diag( "read $bytes_received ($attempts r/w attempts)" ); close($from_client); } # wait until client exits wait; } exit; sub ok { print "ok # [$ID] @_\n"; } sub diag { printf "# %7.4f %s\n",gettimeofday()-$start,"@_" ; }
Attaching output compressed, (891K uncompressed -> ~28K w/'xz').
Subject: output.txt.xz
Download output.txt.xz
application/octet-stream 28.2k

Message body not shown because it is not plain text.

Download (untitled) / with headers
text/plain 279b
Am Di 11. Mär 2014, 17:22:21, LAWALSH schrieb: Show quoted text
> Attaching output compressed, (891K uncompressed -> ~28K w/'xz').
The test passed in your output. Does it pass everytime with the modified nonblock.t (which just added debug information) and never with the original nonblock.t ?
Subject: Re: [rt.cpan.org #92403] 2 non blocking tests fail (not sure why)
Date: Sat, 15 Mar 2014 03:06:28 -0700
To: bug-IO-Socket-SSL [...] rt.cpan.org
From: "L. A. Walsh" <pause [...] tlinx.org>
Download (untitled) / with headers
text/plain 717b
Steffen Ullrich via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=92403 > > > Am Di 11. Mär 2014, 17:22:21, LAWALSH schrieb: >
>> Attaching output compressed, (891K uncompressed -> ~28K w/'xz'). >>
> > The test passed in your output. > Does it pass everytime with the modified nonblock.t (which just added debug information) and never with the original nonblock.t ? >
--- And made the test run about 10x longer -- the output slowed the execution speed down from about 3 seconds to over 30. I.e. it sounds like w/o the output there the output to the terminal takes far longer than any output over the net, so the non-blocking test becomes moot. At least, that would be my theory.
Download (untitled) / with headers
text/plain 623b
Show quoted text
> --- > And made the test run about 10x longer -- the output slowed the > execution speed down from about 3 seconds to over 30. I.e. it sounds > like w/o the output there the output to the terminal takes far longer > than any output over the net, so the non-blocking test becomes moot. > > At least, that would be my theory.
This looks for me like a bug in your OS. The test has several sleep(5) inside and due to this it should at least take 15 seconds to execute. Running in only 3 seconds cannot be done, unless these essential sleep statements are ignored. Might it have something to do with your tickless kernel?
Subject: Re: [rt.cpan.org #92403] 2 non blocking tests fail (not sure why)
Date: Sun, 16 Mar 2014 02:10:17 -0700
To: bug-IO-Socket-SSL [...] rt.cpan.org
From: "L. A. Walsh" <pause [...] tlinx.org>
Download (untitled) / with headers
text/plain 1.7k
Steffen Ullrich via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=92403 > > > >
>> --- >> And made the test run about 10x longer -- the output slowed the >> execution speed down from about 3 seconds to over 30. I.e. it sounds >> like w/o the output there the output to the terminal takes far longer >> than any output over the net, so the non-blocking test becomes moot. >> >> At least, that would be my theory. >>
> > This looks for me like a bug in your OS. The test has several sleep(5) inside and due to this it should at least take 15 seconds to execute. Running in only 3 seconds cannot be done, unless these essential sleep statements are ignored. Might it have something to do with your tickless kernel? >
I doubt it -- the 3 seconds was a guess from what I remember... I just the tail end of the fails, so didn't time them. The tickless kernel is the recommended default on linux, and has been for a few-to- maybe 5 years now. It just means it doesn't use a clock tick to keep time, but uses one of the several internal timer devices that are more accurate and go off at programmed times so the kernel can sleep more rather than executing ticks every ms. I use non-block file system i/o in a perl program to scan directory tree's. Goes 2-3 times faster than the blocking variety. Still, the output slowing it down -- the principle is the same. 15->30. If the non-blocking writes were supposed to take ~ 15 seconds total, before being responded to, but the writer is now taking 30 seconds before seeing if it is responded to, it gives a 2x margin on waiting for the, what would have been 15 seconds... whether the writer does 3 or 5 second waits -- now it won't get to those waits for 6 or 10 seconds.
Subject: Re: [rt.cpan.org #92403] 2 non blocking tests fail (not sure why)
Date: Sun, 16 Mar 2014 20:35:16 -0700
To: bug-IO-Socket-SSL [...] rt.cpan.org
From: "L. A. Walsh" <pause [...] tlinx.org>
Download (untitled) / with headers
text/plain 1.8k
Steffen Ullrich via RT wrote: Show quoted text
> This looks for me like a bug in your OS. The test has several sleep(5) > inside and due to this it should at least take 15 seconds to execute. > Running in only 3 seconds cannot be done, unless these essential sleep > statements are ignored. Might it have something to do with your > tickless kernel?
Here's a more accurate run with the timing on the original: Show quoted text
> time perl t/nonblock.t
1..27 ok # [server] Server Initialization # connect in progress ok # [server] tcp accept ok # [client] client tcp connect # wrote 9 bytes ok # [server] received plain text ok # [client] write plain text ok # [client] upgrade client to IO::Socket::SSL # SSL wants a read first ok # [server] upgrade to_client to IO::Socket::SSL # SSL wants a read first ok # [server] ssl accept handshake done ok # [client] connected ok # [client] nonblocking connect with 2 attempts # sndbuf=16384 ok # [server] received client message ok # [client] syswrite not ok # [client] multiple write attempts ok # [client] 30000 bytes send # connect in progress ok # [client] client tcp connect # wrote 9 bytes ok # [client] write plain text # read 30000 (1 r/w attempts) ok # [server] tcp accept ok # [server] received plain text ok # [server] upgrade to_client to IO::Socket::SSL ok # [client] upgrade client to IO::Socket::SSL # SSL wants a read first # SSL wants a read first ok # [server] ssl accept handshake done ok # [server] nonblocking accept_SSL with 2 attempts ok # [client] connected # sndbuf=16384 ok # [server] received client message ok # [client] syswrite not ok # [client] multiple write attempts ok # [client] 30000 bytes send # read 30000 (2 r/w attempts) 15.96sec 1.54usr 0.31sys (11.64% cpu) ----------------------- It looks like it fails because SSL claims to want a read while the server is trying to write? (Don't know anything about the proto... ). Would the client have more data to send?
Download (untitled) / with headers
text/plain 330b
Just an update to let you know that the bug is not forgotten. I'm unable to reproduce it, so I'm guessing it has something to do with the interaction with socket buffers on your system. Could you please add the relevant configuration on your system, e.g. output of sysctl net.ipv4.tcp_mem net.ipv4.tcp_rmem net.ipv4.tcp_wmem
Download (untitled) / with headers
text/plain 2.7k
On Thu May 15 02:42:25 2014, SULLR wrote: Show quoted text
> Just an update to let you know that the bug is not forgotten. > I'm unable to reproduce it, so I'm guessing it has something to do > with the interaction with socket buffers on your system. Could you > please add the relevant configuration on your system, e.g. output of
--- It's ok , I don't have anything critical waiting on this... I just found it in installing various deps for other stuff and manually hacked the installer for this so work could continue -- but it will fail again next time I install an update...so that's the rough timeframe ... but nothing critical... The numbers you asked for: net.ipv4.tcp_mem = 16777216 33554432 67108864 net.ipv4.tcp_rmem = 16777216 16777216 33554432 net.ipv4.tcp_wmem = 16777216 16777216 33554432 --- just to be "safe", I'm adding in the other tcp settings here just in case any of them make a difference: tcp_abort_on_overflow 0 tcp_adv_win_scale 4 tcp_allowed_congestion_control highspeed htcp reno scalable lp tcp_app_win 31 tcp_autocorking 1 tcp_available_congestion_control highspeed htcp reno scalable lp tcp_base_mss 1400 tcp_challenge_ack_limit 100 tcp_congestion_control highspeed tcp_dsack 0 tcp_early_retrans 3 tcp_ecn 2 tcp_fack 0 tcp_fastopen 1 tcp_fin_timeout 60 tcp_frto 2 tcp_keepalive_intvl 75 tcp_keepalive_probes 9 tcp_keepalive_time 7200 tcp_limit_output_bytes 262144 tcp_low_latency 1 tcp_max_orphans 262144 tcp_max_syn_backlog 2048 tcp_max_tw_buckets 262144 tcp_mem 16777216 33554432 67108864 tcp_min_tso_segs 2 tcp_moderate_rcvbuf 0 tcp_mtu_probing 0 tcp_no_metrics_save 0 tcp_notsent_lowat -1 tcp_orphan_retries 0 tcp_reordering 512 tcp_retrans_collapse 1 tcp_retries1 3 tcp_retries2 15 tcp_rfc1337 0 tcp_rmem 16777216 16777216 33554432 tcp_sack 1 tcp_slow_start_after_idle 0 tcp_stdurg 0 tcp_syn_retries 6 tcp_synack_retries 5 tcp_syncookies 1 tcp_thin_dupack 0 tcp_thin_linear_timeouts 0 tcp_timestamps 0 tcp_tso_win_divisor 3 tcp_tw_recycle 0 tcp_tw_reuse 0 tcp_window_scaling 1 tcp_wmem 16777216 16777216 33554432 tcp_workaround_signed_windows 0 udp_mem 2097152 8388608 16777216 udp_rmem_min 262144 udp_wmem_min 262144 Show quoted text
> > sysctl net.ipv4.tcp_mem net.ipv4.tcp_rmem net.ipv4.tcp_wmem
From: Carson Gaspar
Download (untitled) / with headers
text/plain 765b
FYI I have the exact same problem on Solaris 11.2. Net-SSLeay 1.70 perl 5.22.0 Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_LONG_DOUBLE USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API
Download (untitled) / with headers
text/plain 226b
Hi, can you try my patch and see if it fixes your problem? I ran into the problem on HP-UX but believe it will happen on a few other ancient platforms such as Solaris and AIX. https://rt.cpan.org/Ticket/Display.html?id=106573
Download (untitled) / with headers
text/plain 441b
Am Do 20. Aug 2015, 21:24:18, AGRUNDMA schrieb: Show quoted text
> Hi, can you try my patch and see if it fixes your problem? I ran into > the problem on HP-UX but believe it will happen on a few other ancient > platforms such as Solaris and AIX. > > https://rt.cpan.org/Ticket/Display.html?id=106573
The request is closed in the hope that the referred patch (which was included in IO::Socket::SSL 2 month ago) fixed the problem (there was no feedback).
Subject: [rt.cpan.org #92403]
Date: Tue, 28 Nov 2017 06:23:28 +0000
To: "bug-IO-Socket-SSL [...] rt.cpan.org" <bug-IO-Socket-SSL [...] rt.cpan.org>
From: "Holman, Brett" <holmanb0214 [...] my.uwstout.edu>
Download (untitled) / with headers
text/plain 13.9k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/html 18.7k

Message body is not shown because it is too large.

Download (untitled) / with headers
text/plain 784b
Am Di 28. Nov 2017, 01:23:48, holmanb0214@my.uwstout.edu schrieb: Show quoted text
> I am getting this issue using raspberry pi zero and Raspbian Stretch. > I am attempting to install using cpanm. I originally was only getting > test 26 failing, but after doing a apt-get update and apt-get upgrade, > I'm now seeing both tests 13 and 26 as failed. I'd be happy to > provide any more information to get this resolved.
Sorry for the late response. But your information were added to a bug which was already closed a few years ago. If the problem persists please open a new bug and provide more detailled information: not only the version of Perl and the OS but also the version of the IO::Socket::SSL module and the verbose output of all tests, not only the failing ones (make test TEST_VERBOSE=1).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.