develooper Front page | perl.perl5.porters | Postings from May 2012

Re: Perl 5.16.0 RC2 io_sock.t on Windows

Thread Next
From:
Alex Gough
Date:
May 16, 2012 02:13
Subject:
Re: Perl 5.16.0 RC2 io_sock.t on Windows
Message ID:
20120516091333.GC30714@the.earth.li
#### [Fri, May 11, 2012 at 07:29:45PM +1000: Tony Cook]
> On Fri, May 11, 2012 at 10:10:08AM +0100, Steve Hay wrote:
> > Ricardo Signes wrote on 2012-05-11:
> > > I've just uploaded the first release candidate of Perl 5.16.0 to
> > PAUSE.
> > > 
> > > The files should be available soon, with the following SHA sums:
> > > 
> > >   3f08f8e00adc215ccbf6aff38c58eef58f4df102  perl-5.16.0-RC0.tar.bz2
> > >   99ce35a3e1a48b6936e3e2e56966cb6736181875  perl-5.16.0-RC0.tar.gz 
> > 
> > Default build out-of-the-box on Windows 7 x64 with VC++ 2010 SP1 is
> > sadly not a pleasant experience for me. As reported previously, numerous
> > tests hang and have to be killed, yielding the test results below. As
> > noted before, however, all is well aside from the intermittent fork.t
> > test 24 failure if STDERR is redirected somewhere.
> 
> I get similar failures with the SDK compiler.
> 
> io_sock.t has been behaving for me recently though.

I'm pretty sure this is exposing a race condition in how Windows deals
with sockets which are closed while data is sitting on them. These failures
are not exposing any problems with Perl's socket handling so are not a bug.
See attached if you enjoy winsock tracing output.

They can be avoided by sleeping a bit more in the tests, which the patch below
does. I've made the sleeps windows specific to save others from waiting.

With this change, RC2 builds and tests reliably under SDK7.1/Debug/x64,
except for the passing TODO tests.

alex@BIRDSONG ~/Documents/perldev/perl-5.16.0-RC2
$ diff -urN dist/IO/t/io_sock.t.orig dist/IO/t/io_sock.t
--- dist/IO/t/io_sock.t.orig    Wed Feb 15 17:44:45 2012
+++ dist/IO/t/io_sock.t Wed May 16 21:02:50 2012
@@ -125,6 +125,7 @@
        print "ok 8\n";
        $sock->print("ok 9\n");
        $sock->print("done\n");
+       sleep(1) if $^O eq "MSWin32";
        $sock->close;
     }
     else {
@@ -142,6 +143,7 @@
     if ($sock) {
        $sock->print("ok 10\n");
        $sock->print("done\n");
+       sleep(1) if $^O eq "MSWin32";
        $sock->close;
     }
     else {
@@ -162,6 +164,7 @@
     } else {
        print "not ok 11\n";
     }
+    sleep(1) if $^O eq "MSWin32";
     $sock = undef;
     sleep(1);
     exit;

-- 
Underlying all this is the Principle of Least Surprise. Do not confuse this
with the Principle of Zero Surprise, which usually means you've swept the real
surprises under some else's carpet. (There's a certain amount of surprise you
can't go below--the Heisenberg Uncertainty Principle applies to software too.)

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About