New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
race condition+fail in dist\IO\t\cachepropagate-tcp.t #12979
Comments
From @bulk88Created by @bulk88There is a race condition in cachepropagate-tcp.t between the parent ___________________________________________________________________________ Test Summary Report C:\p519\src\t> running with -v, Test Summary Report C:\p519\src\t> line 46 is
accept the function in IO::Socket::accept the method fails with $! being The failing test was added in If I put a "sleep(1);" before the ->accept(), it passes for me most (4 Perl Info
|
From @tonycozOn Sun May 19 20:24:50 2013, bulk88 wrote:
___________________________________________________________________________
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 I changes the code so the child reads a line from the socket, and I'll try a smoke-me to see if it breaks anywhere else. Tony |
The RT System itself - Status changed from 'new' to 'open' |
From @kmxI get the same failure with perl-5.18.0 + gcc-4.7.3 + 32bit MS Windows It fails always -- |
From @bulk88On Mon May 20 02:10:13 2013, tonyc wrote:
Any updates TonyC? -- |
From @tonycozOn Thu, Jun 27, 2013 at 04:34:17PM -0700, bulk88 via RT wrote:
It smoked ok, but I don't trust that it fixes the underlying problem My theory above, as written, is hopefully nonsense - Windows returning For a Real™ fork() any open file handles or sockets are cloned in the Under Win32 we emulate that, which I suspect is the real cause of the win32_fdupopen() calls win32_dup() a trivial wrapper around dup() - Tony |
From @tonycozOn Thu Jun 27 23:50:22 2013, tonyc wrote:
This theory turned out to be nonsense, I'm exploring the behaviour some Tony |
From @tonycozOn Tue Aug 27 16:41:11 2013, tonyc wrote:
Amongst many other things I tried, I changed win32_accept to: win32_accept(SOCKET s, struct sockaddr *addr, int *addrlen) SOCKET_TEST((r = accept(TO_SOCKET(s), addr, addrlen)), INVALID_SOCKET); The output from a failed run looked like: 1..8 So it seems some race is closing the accept()ed socket before we get to Pretty much any output I do in the child or parent before the accept() Tony |
From @bulk88On Wed Aug 28 18:09:32 2013, tonyc wrote:
Using freeze/thaw features of the parent and child OS threads, the bug 1. somewhere a CloseHandle was done on a socket handle, which isn't 2. a double free (using the correct closesocket() command) was done, I include 2 screen shots of why I think the above. The break happened at -- |
From @bulk88On Fri Sep 20 01:14:51 2013, bulk88 wrote:
forgot the attachments -- |
From @bulk88 |
From @bulk88 |
From @bulk88Adding a trimmed down test version of cacheproagate-tcp.t to isolate Shouldn't $^E be 10038 not 6 at this point? Is this another "bug" or -- |
From @bulk881..6 |
From @bulk88 |
From @bulk881..6 |
From @bulk88On Wed Sep 25 23:42:55 2013, bulk88 wrote:
Made an ithreads version which freezes the server thread that does the Is this a handle leak in Perl PLUS a race in winsock? The script can be messed around with. |
From @bulk88 |
From @bulk88Adding some things I said in IRC for archival reasons. Would this make any sense, in Winsock, if a process does a loopback Invalid handle exception with C debugger.
The invalid handle passed to NtClose in the parent thread is the same OS The pointer memory write stuff was the fastest way I though of for the The accept actually fails with 10038 WSAENOTSOCK but PerlIO corrupts it Because of the is a loopback in the same process implemented using pipes This is an answer for another TonyC question. The fds in a successful |
From @steve-m-hayFixed by commit b47a847 from #120091, so closing this ticket too :-) |
@steve-m-hay - Status changed from 'open' to 'resolved' |
It seems that this is the Perl bug that causes the socket failures: Perl/perl5#12979 Also add sleeps to 44_sess.t because it fails similarly to 07_sslecho.t.
…ls on Windows. (#366) Calling a one second sleep before each connect to server seems fix the occasionally occurring failures. Sleep is now done when running on Windows and Perl is earlier than 5.20.0. For the details, see GH-356 and look for CloseHandle() in Perl 5.20.0 changelog. It seems that this is the Perl bug that causes the socket failures: Perl/perl5#12979
…ls on Windows. (#366) Calling a one second sleep before each connect to the server seems fix the occasionally occurring failures. Sleep is now done when running on Windows and Perl is earlier than 5.20.0. For the details, see GH-356 and look for CloseHandle() in Perl 5.20.0 changelog. It seems that this is the Perl bug that causes the socket failures: Perl/perl5#12979
Migrated from rt.perl.org#118059 (status was 'resolved')
Searchable as RT118059$
The text was updated successfully, but these errors were encountered: