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

rapid network interaction crashes something #6044

Open
p6rt opened this issue Feb 1, 2017 · 5 comments
Open

rapid network interaction crashes something #6044

p6rt opened this issue Feb 1, 2017 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Feb 1, 2017

Migrated from rt.perl.org#130689 (status was 'open')

Searchable as RT130689$

@p6rt
Copy link
Author

p6rt commented Feb 1, 2017

From robertle@semistable.com

hi everyone,

I have these two tiny pieces of code​:

---------------------------8<-- server.p6 --------------------------
my $listen = IO​::Socket​::INET.new(​:listen, :localhost<127.0.0.1>,
:localport(3333));
loop {
  my $conn = $listen.accept;
  while my $buf = $conn.recv(​:bin) {
  $conn.write($buf);
  }
  $conn.close;
}
--------------------------->8---------------------------------------

---------------------------8<-- client.p6 --------------------------
loop (my $i = 0; $i <= $conn_count; $i++) {
  my $conn = IO​::Socket​::INET.new(host => '127.0.0.1', port => 3333);
  loop (my $j = 0; $j <= $echo_count; $j++) {
  $conn.print("woohoo $i $j\n");
# critical line below​: if removed the server crashes without much
# evidence of what is going on... a say does the same trick
  sleep 0.0001;
  }
  $conn.close;
}

--------------------------->8---------------------------------------

I start up the server and then the client, which runs for about 20s and
then exits as expected. the server stays up.

if you remove the sleep in the client, the server process stops at some
point through without any output.

This is Rakudo version 2017.01-132-g97359ae built on MoarVM version
2017.01-25-g70d4bd5

please let me know if there is anything I can do to help debug or
understand better

thanks robert

--
Robert Lemmen http://www.semistable.com

@p6rt
Copy link
Author

p6rt commented Feb 2, 2017

From @zoffixznet

On Wed, 01 Feb 2017 09​:03​:37 -0800, robertle@​semistable.com wrote​:

hi everyone,

I have these two tiny pieces of code​:

---------------------------8<-- server.p6 --------------------------
my $listen = IO​::Socket​::INET.new(​:listen, :localhost<127.0.0.1>,
:localport(3333));
loop {
my $conn = $listen.accept;
while my $buf = $conn.recv(​:bin) {
$conn.write($buf);
}
$conn.close;
}
--------------------------->8---------------------------------------

---------------------------8<-- client.p6 --------------------------
loop (my $i = 0; $i <= $conn_count; $i++) {
my $conn = IO​::Socket​::INET.new(host => '127.0.0.1', port => 3333);
loop (my $j = 0; $j <= $echo_count; $j++) {
$conn.print("woohoo $i $j\n");
# critical line below​: if removed the server crashes without much
# evidence of what is going on... a say does the same trick
sleep 0.0001;
}
$conn.close;
}

--------------------------->8---------------------------------------

I start up the server and then the client, which runs for about 20s and
then exits as expected. the server stays up.

if you remove the sleep in the client, the server process stops at some
point through without any output.

This is Rakudo version 2017.01-132-g97359ae built on MoarVM version
2017.01-25-g70d4bd5

please let me know if there is anything I can do to help debug or
understand better

thanks robert

Can't reproduce on 2017.01-121-gf94cb21. Your client script is using $conn_count and $echo_count but neither is defined. What values are those supposed to be at? Is there anything else missing?

@p6rt
Copy link
Author

p6rt commented Feb 2, 2017

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

@p6rt
Copy link
Author

p6rt commented Feb 2, 2017

From robertle@semistable.com

apologies for a possible duplication, I thought replying to the email would
attach my reply to this bug as well, which does not appear to be the case...

On Thu, 02 Feb 2017 10​:38​:10 -0800, cpan@​zoffix.com wrote​:

Can't reproduce on 2017.01-121-gf94cb21. Your client script is using
$conn_count and $echo_count but neither is defined. What values are
those supposed to be at? Is there anything else missing?

sorry, didn't mean to snip these off. they are​:

my $conn_count = 10000;
my $echo_count = 10;

otherwise there is only a "use v6;" and a shebang in each file. I donm't
do anything crazy around it either, just start em up. I failed to
mention my system however, which is a 4.8.0-2-amd64 linux.

I just retried it, with the "say" line it works, without the say the
server exits. no message, but this time I checked the exit code which is
141 consistently across multiple runs. perhaps that helps a bit...

@p6rt
Copy link
Author

p6rt commented Feb 3, 2017

From robertle@semistable.com

On Thu, Feb 02, 2017 at 10​:38​:10AM -0800, Zoffix Znet via RT wrote​:

Can't reproduce on 2017.01-121-gf94cb21. Your client script is using $conn_count and $echo_count but neither is defined. What values are those supposed to be at? Is there anything else missing?

sorry, didn't mean to snip these off. they are​:

my $conn_count = 10000;
my $echo_count = 10;

otherwise there is only a "use v6;" and a shebang in each file. I donm't
do anything crazy around it either, just start em up. I failed to
mention my system however, which is a 4.8.0-2-amd64 linux.

I just retried it, with the "say" line it works, without the say the
server exits. no message, but this time I checked the exit code which is
141 consistently across multiple runs. perhaps that helps a bit...

regards robert

--
Robert Lemmen http://www.semistable.com

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