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

IO::Socket::Async + `run` exits unexpectedly on [OSX] #4624

Open
p6rt opened this issue Oct 6, 2015 · 1 comment
Open

IO::Socket::Async + `run` exits unexpectedly on [OSX] #4624

p6rt opened this issue Oct 6, 2015 · 1 comment
Labels

Comments

@p6rt
Copy link

@p6rt p6rt commented Oct 6, 2015

Migrated from rt.perl.org#126277 (status was 'new')

Searchable as RT126277$

@p6rt
Copy link
Author

@p6rt p6rt commented Oct 6, 2015

From tokuhirom@gmail.com

When call `run` method in IO​:Socket​::Async.listen routine, perl6-m exits unexpectedly on Mac OS X.

Following test code pass on linux. But it fails on linux.

```
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use 5.010000;
use autodie;

use Test​::More;
use IO​::Socket​::INET;

my $pid = fork();
if ($pid > 0) { # parent
  say 'sleep';

  sleep 3;

  say 'connect';
  my $sock = IO​::Socket​::INET->new(PeerAddr => 'localhost​:5000');
  $sock or die;
  my $msg = <$sock>;
  is $msg, "yo\n";
  kill 'TERM', $pid;
  waitpid $pid, 0;
} elsif ($pid == 0) {
  say 'executing server';
  exec 'perl6-m', '-e', <<'EOF';
use v6;

sub MAIN($port=5000) {
  react {
  whenever IO​::Socket​::Async.listen('127.0.0.1', $port) -> $conn {
  run 'ls'; # process exits at here.
  await $conn.print("yo\n");
  $conn.close();
  }
  }
}
EOF
} else {
die 'fork failed';
}

done_testing;
```

output on linux​:
```
sleep
executing server
connect
foo.pl6 hoge.pl projects.json
ok 1
1..1
```

output on mac​:
```
sleep
executing server
connect
LICENSE META6.json README.md bin eg hoge.pl lib server.pl6 t
not ok 1
# Failed test at hoge.pl line 21.
# got​: undef
# expected​: 'yo
# '
1..1
# Looks like you failed 1 test of 1.
```

Version is​:
```
This is perl6 version 2015.09-210-gef814c3 built on MoarVM version 2015.09-39-g1434283
```

@p6rt p6rt added the conc label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.