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

recv() segfault #2876

Closed
p6rt opened this issue Sep 12, 2012 · 4 comments
Closed

recv() segfault #2876

p6rt opened this issue Sep 12, 2012 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Sep 12, 2012

Migrated from rt.perl.org#114866 (status was 'resolved')

Searchable as RT114866$

@p6rt
Copy link
Author

p6rt commented Sep 12, 2012

From slunski@gmail.com

Hi,

That code​:

#!/usr/bin/env perl6

# Local Redis server
my $h = "127.0.0.1";
my $p = '6379';

my $s = IO​::Socket​::INET.new( host => $h, port => $p.Int )or die();
$s.input-line-separator = "\r\n";

$s.send( "set a łąka\r\n" );
my $r = $s.recv();
$s.send( "get a\r\n" );
$s.get();
#my $g = $s.get();
my $g2 = $s.recv();
say "D​: ", $g2.perl;

prints more then received from network or segfaults.

Output is like below when not segfault​:

D​: "łąka\r\n\b\x[90]"

or

D​: "łąka\r\n\b\x[0]"

but network sends only string with ending​:

"łąka\r\n"

--
Sylwester £uñski, slunski@​gmail.com

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

From @FROGGS

It works for me with latest patch made by moritz++ today​:

./perl6 -e 'my $listener = IO​::Socket​::INET.new( localhost => "",
localport => 8080, :listen ); while my $connection = $listener.accept( )
{ $connection.send( "set a łąka\r\n" ); $connection.close( ); }'

./perl6 -e 'my $client = IO​::Socket​::INET.new( host => "localhost", port
=> 8080 ); $client.input-line-separator = "\r\n"; my $inc = $client.get;
say $inc.perl'
OUTPUT​: "set a łąka"

Though I can't use your test script, since I think my firewall doesnt
like it.

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

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

@p6rt
Copy link
Author

p6rt commented Jan 24, 2013

@moritz - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 24, 2013
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