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

[perl #118059] race condition+fail in dist\IO\t\cachepropagate-tcp.t

Thread Next
From:
Tony Cook via RT
Date:
May 20, 2013 09:10
Subject:
[perl #118059] race condition+fail in dist\IO\t\cachepropagate-tcp.t
Message ID:
rt-3.6.HEAD-8880-1369041013-1869.118059-15-0@perl.org
On Sun May 19 20:24:50 2013, bulk88 wrote:
> There is a race condition in cachepropagate-tcp.t between the parent
> proc's accept() and the child proc's connection since the child proc
> has
> a "sleep(1);" delay. On my Win32 32 bit, Server 2003 x64, 8 core, VC
> 2008 Perl, the ->accept() times out, does not return an obj, and then
> fatally errors when ->sockdomain() is called on an undefined scalar.
> Example
> 
>
___________________________________________________________________________
> C:\p519\src\t>..\perl.exe -I..\lib harness
> ../dist/IO/t/cachepropagate-tcp.t
> ../dist/IO/t/cachepropagate-tcp.t .. 1/8 Can't call method
> "sockdomain"
> on an un
> defined value at t/cachepropagate-tcp.t line 46.
> # Looks like you planned 8 tests but ran 5.
> # Looks like your test exited with 9 just after 5.
> ../dist/IO/t/cachepropagate-tcp.t .. Dubious, test returned 9 (wstat
> 2304, 0x900
> )
> Failed 3/8 subtests

I see this failure maybe 1 in 20 runs (Windows 7 x64, Core i7).

I suspect the problem is that winsock is invalidating the accept socket 
once the child socket goes out of scope, causing a race in the accept()
implementation.

I changes the code so the child reads a line from the socket, and 
the parent closes the socket.  With that I had 2700 successful runs
before I stopped testing.

I'll try a smoke-me to see if it breaks anywhere else.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=118059

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