Skip to content
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 in test IO/t/io_unix.t #15058

Closed
p5pRT opened this issue Nov 22, 2015 · 12 comments
Closed

Race condition in test IO/t/io_unix.t #15058

p5pRT opened this issue Nov 22, 2015 · 12 comments

Comments

@p5pRT
Copy link

p5pRT commented Nov 22, 2015

Migrated from rt.perl.org#126707 (status was 'rejected')

Searchable as RT126707$

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2015

From sergle.ua@gmail.com

When trying to compile perl-5.22.0 on Linux Ubuntu 14.04 inside VirtualBox,
make test always gives me​:
  Failed 1 test out of 2215, 99.95% okay.
  ../dist/IO/t/io_unix.t

Test is ok when I tried to compile Perl just in Linux without VirtualBox.

Test failed because 'ok 4' is missing from output.
It looks like that closing socket in parent process prevents the child
process to read this line.
So issue can be observed only in some slow environment.

With attached patch all tests passed in VirtualBox VM.

--
Sergey

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2015

From sergle.ua@gmail.com

io_unix_test.patch
diff --git a/dist/IO/t/io_unix.t b/dist/IO/t/io_unix.t
index 61ba363..3fcf376 100644
--- a/dist/IO/t/io_unix.t
+++ b/dist/IO/t/io_unix.t
@@ -85,9 +85,10 @@ if($pid = fork()) {
 
 	print $sock "ok 4\n";
 
+	waitpid($pid,0);
+
 	$sock->close;
 
-	waitpid($pid,0);
 	unlink($PATH) || $^O eq 'os2' || warn "Can't unlink $PATH: $!";
 
 	print "ok 5\n";

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2015

From @jkeenan

On Sat Nov 21 17​:27​:17 2015, sergle.ua@​gmail.com wrote​:

When trying to compile perl-5.22.0 on Linux Ubuntu 14.04 inside VirtualBox,
make test always gives me​:
Failed 1 test out of 2215, 99.95% okay.
../dist/IO/t/io_unix.t

Test is ok when I tried to compile Perl just in Linux without VirtualBox.

Test failed because 'ok 4' is missing from output.
It looks like that closing socket in parent process prevents the child
process to read this line.
So issue can be observed only in some slow environment.

With attached patch all tests passed in VirtualBox VM.

Smoke-testing in branch smoke-me/jkeenan/126707-waitpid. In particular, we need to see what the impact of this revision is on the test's performance on OSes other than Linux.

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Nov 22, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Nov 25, 2015

From @tonycoz

On Sat Nov 21 17​:27​:17 2015, sergle.ua@​gmail.com wrote​:

When trying to compile perl-5.22.0 on Linux Ubuntu 14.04 inside VirtualBox,
make test always gives me​:
Failed 1 test out of 2215, 99.95% okay.
../dist/IO/t/io_unix.t

Test is ok when I tried to compile Perl just in Linux without VirtualBox.

Test failed because 'ok 4' is missing from output.
It looks like that closing socket in parent process prevents the child
process to read this line.
So issue can be observed only in some slow environment.

That explanation seems strange on Linux, I know Win32 sockets (which doesn't support UNIX sockets) tends to discard buffered data when the sender closes, but that shouldn't be the case on Linux.

I've run make test many times in VirtualBox VMs, though not recently. Updating my Ubuntu VM now for further testing.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 25, 2015

From sergle.ua@gmail.com

On Wed, Nov 25, 2015 at 2​:00 AM, Tony Cook via RT <perlbug-followup@​perl.org

wrote​:

That explanation seems strange on Linux, I know Win32 sockets (which
doesn't support UNIX sockets) tends to discard buffered data when the
sender closes, but that shouldn't be the case on Linux.

This may ​be a reason, because I run VirtulBox (latest 5.0.10) with Ubuntu
15.04 (guest OS) on my laptop with Windows 7 x64 (host OS).
Here I'm building a docker image - compile perl 5.22, based on Ubuntu 14.04
image.
I tried to build the same image (same Dockerfile) on workstation with
Ubuntu 14.04 host (without VirtualBox) - issue is not observed.

--
Sergey

@p5pRT
Copy link
Author

p5pRT commented Nov 25, 2015

From sergle.ua@gmail.com

This may ​be a reason, because I run VirtulBox (latest 5.0.10) with Ubuntu
15.04 (guest OS) on my laptop with Windows 7 x64 (host OS).
Here I'm building a docker image - compile perl 5.22, based on Ubuntu 14.04
image.
I tried to build the same image (same Dockerfile) on workstation with
Ubuntu 14.04 host (without VirtualBox) - issue is not observed.

--
Sergey

@p5pRT
Copy link
Author

p5pRT commented Oct 16, 2017

From @tonycoz

On Wed, 25 Nov 2015 05​:20​:22 -0800, sergle.ua@​gmail.com wrote​:

This may ​be a reason, because I run VirtulBox (latest 5.0.10) with Ubuntu
15.04 (guest OS) on my laptop with Windows 7 x64 (host OS).
Here I'm building a docker image - compile perl 5.22, based on Ubuntu 14.04
image.
I tried to build the same image (same Dockerfile) on workstation with
Ubuntu 14.04 host (without VirtualBox) - issue is not observed.

Can you still reproduce this?

This can't be associated with the host - Unix sockets are implemented in the guest (and Win32 doesn't have Unix sockets anyway).

Tony

@p5pRT
Copy link
Author

p5pRT commented Oct 19, 2017

From sergle.ua@gmail.com

On Tue, Oct 17, 2017 at 2​:21 AM, Tony Cook via RT <perlbug-followup@​perl.org

wrote​:

On Wed, 25 Nov 2015 05​:20​:22 -0800, sergle.ua@​gmail.com wrote​:

This may ​be a reason, because I run VirtulBox (latest 5.0.10) with
Ubuntu
15.04 (guest OS) on my laptop with Windows 7 x64 (host OS).
Here I'm building a docker image - compile perl 5.22, based on Ubuntu
14.04
image.
I tried to build the same image (same Dockerfile) on workstation with
Ubuntu 14.04 host (without VirtualBox) - issue is not observed.

Can you still reproduce this?

This can't be associated with the host - Unix sockets are implemented in
the guest (and Win32 doesn't have Unix sockets anyway).

​Now with VirtualBox 5.1.28 and Ubuntu 16.04 as guest OS issue is not
reproduced.
Tried Perl 5.22, 5.26​

--
Sergey

@p5pRT
Copy link
Author

p5pRT commented Oct 21, 2017

From @jkeenan

On Thu, 19 Oct 2017 13​:26​:37 GMT, sergle.ua@​gmail.com wrote​:

On Tue, Oct 17, 2017 at 2​:21 AM, Tony Cook via RT <perlbug-followup@​perl.org

wrote​:

On Wed, 25 Nov 2015 05​:20​:22 -0800, sergle.ua@​gmail.com wrote​:

This may ​be a reason, because I run VirtulBox (latest 5.0.10) with
Ubuntu
15.04 (guest OS) on my laptop with Windows 7 x64 (host OS).
Here I'm building a docker image - compile perl 5.22, based on Ubuntu
14.04
image.
I tried to build the same image (same Dockerfile) on workstation with
Ubuntu 14.04 host (without VirtualBox) - issue is not observed.

Can you still reproduce this?

This can't be associated with the host - Unix sockets are implemented in
the guest (and Win32 doesn't have Unix sockets anyway).

​Now with VirtualBox 5.1.28 and Ubuntu 16.04 as guest OS issue is not
reproduced.
Tried Perl 5.22, 5.26​

This ticket seems closable. TonyC, do you concur?

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2017

From @tonycoz

On Fri, 20 Oct 2017 19​:20​:54 -0700, jkeenan wrote​:

This ticket seems closable. TonyC, do you concur?

Yes, closed.

Tony

@p5pRT
Copy link
Author

p5pRT commented Oct 29, 2017

@tonycoz - Status changed from 'open' to 'rejected'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant