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

Example code in IO::Socket::INET crashes #1963

Closed
JJ opened this issue Apr 26, 2018 · 3 comments
Closed

Example code in IO::Socket::INET crashes #1963

JJ opened this issue Apr 26, 2018 · 3 comments
Labels
update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.

Comments

@JJ
Copy link
Contributor

JJ commented Apr 26, 2018

The problem

This code that shows up in the examples of IO::Socket::INET apparently crashes when closing the connection

This is the error with which it crashes

Could not receive data from socket: Connection reset by peer                    
  in block <unit> at server-io-socket.p6 line 9

Suggestions

Check if this is a new bug and file a report where it belongs and/or fix the example code accordingly.

@fluca1978
Copy link
Contributor

Tested on an old version, moar 2017.12, and it worked without crashing.

@fluca1978
Copy link
Contributor

Tested again on 2018.04, not crashing...

% perl6 -v
This is Rakudo version 2018.04 built on MoarVM version 2018.04
implementing Perl 6.c.

@JJ
Copy link
Contributor Author

JJ commented Apr 28, 2018

The code that's crashing is the one in the StackOverflow question. It's very similar to the one in the example.

fluca1978 added a commit that referenced this issue Apr 28, 2018
As for issue #1963 it seems that without the try-catch the loop can crash
the server if the client does wait (sleep) or do something strange with the
incoming data.
Seems to me a flushing problem.

Tested on moar 2018.04.
@JJ JJ added the update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc. label Apr 30, 2018
@JJ JJ closed this as completed in 33fab2f May 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
update part of "docs" - indicates this is an update for an existing section; rewrite, clarification, etc.
Projects
None yet
Development

No branches or pull requests

2 participants