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

Rakudo on MoarVM segfaults on simple IO::Socket::Async echo server #3712

Open
p6rt opened this issue Mar 2, 2015 · 1 comment
Open

Rakudo on MoarVM segfaults on simple IO::Socket::Async echo server #3712

p6rt opened this issue Mar 2, 2015 · 1 comment
Labels
SEGV Segmentation fault, bus error, etc.

Comments

@p6rt
Copy link

p6rt commented Mar 2, 2015

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

Searchable as RT123968$

@p6rt
Copy link
Author

p6rt commented Mar 2, 2015

From @moritz

THe fllowing program​:

use v6;
my $connections = IO​::Socket​::Async.listen(
  'localhost',
  3333,
);
$connections.tap(-> $conn {
  say "Incoming connection";
  $conn.bytes_supply.tap(
  -> $buf {
  say $buf.decode;
  await $conn.write($buf)
  },
  :done({ $conn.close })
  )
  },
);
$connections.wait;

segfaults reliables when I execute it with perl6 version
2015.02-152-ge7a666c
built on MoarVM version 2015.02-17-g86d0c68 as soon as I feed it some input​:

$ echo "foo" | nc localhost 3333

Running under gdb produces this backtrace​:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff33c5700 (LWP 15427)]
0x00007ffff79fc2e1 in uv_write2 () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
(gdb) bt
#​0 0x00007ffff79fc2e1 in uv_write2 () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​1 0x00007ffff79a10f2 in write_setup () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​2 0x00007ffff7999da0 in idle_handler () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​3 0x00007ffff79f8b1a in uv.run_idle () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​4 0x00007ffff79f51ec in uv_run () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​5 0x00007ffff7999d34 in enter_loop () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​6 0x00007ffff7986256 in thread_initial_invoke () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​7 0x00007ffff7969b6d in MVM_interp_run () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​8 0x00007ffff79862ae in start_thread () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​9 0x00007ffff79fcd87 in uv.thread_start () from
/home/moritz/p6/rakudo/install/lib/libmoar.so
#​10 0x00007ffff6f69182 in start_thread (arg=0x7ffff33c5700) at
pthread_create.c​:312
#​11 0x00007ffff757f47d in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S​:111

Running it under gdb prevents the segfault on the first connection, and
on the
second, produces this​:

==15474== Thread 3​:
==15474== Invalid read of size 4
==15474== at 0x4FE92E1​: uv_write2 (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F8E0F1​: write_setup (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F86D9F​: idle_handler (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4FE5B19​: uv__run_idle (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4FE21EB​: uv_run (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F86D33​: enter_loop (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F73255​: thread_initial_invoke (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F56B6C​: MVM_interp_run (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4F732AD​: start_thread (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x4FE9D86​: uv__thread_start (in
/home/moritz/p6/rakudo/install/lib/libmoar.so)
==15474== by 0x5A9A181​: start_thread (pthread_create.c​:312)
==15474== by 0x54C147C​: clone (clone.S​:111)
==15474== Address 0xb8 is not stack'd, malloc'd or (recently) free'd

before producing a segfault with the same stacktrace as gdb.

@p6rt p6rt added the SEGV Segmentation fault, bus error, etc. label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SEGV Segmentation fault, bus error, etc.
Projects
None yet
Development

No branches or pull requests

1 participant