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

Problem with sample socket code: core dump from malloc failure and memory corruption #6684

p6rt opened this issue Apr 30, 2018 · 1 comment


Copy link

@p6rt p6rt commented Apr 30, 2018

Migrated from (status was 'new')

Searchable as RT133162$

Copy link

@p6rt p6rt commented Apr 30, 2018


I'm trying to run this code​:

my $n;
await IO​::Socket​::Async.connect('', 5000).then( -> $promise {
  given $promise.result {
  react {
  whenever .Supply(​:enc("utf8-c8")).lines -> $v {
# whenever .Supply() -> $v {
  printf "%d %s\n", ++$n, $v;
# $v.print;
# done;
  ## .close;

In my particular case, the input from port 5000 is RAW IRC lines relayed
through a socket from a script running under my client; live input. The
above program terminates abnormally with the error message after a few
thousand lines​:

*** Error in `/usr/local/bin/moar'​: malloc()​: memory corruption​:
0x00007f133c158840 ***

One of the guys in #perl6 on Freenode reports​:

this works for reproducing the leak​: yes | pv -L 30m | netcat -l -p 5000

He also reports rapidly increasing memory consumption before the OOM killer
gets it, and that even after stopping the 'yes', his line continues
producing output. He's suggested this might be a memory leak. Mine was a
much longer running experience (usually), with no increase in CPU or MEM as
reported by htop, but I *have* noticed that whole batches of lines are
printed without line numbers.

I'm running Rakudo Star version 2018.01 built on MoarVM version 2018.01,
implementing Perl 6.c, on an Ubuntu 16.04 machine (64-bit) with
distro-supplied kernel, libc and libraries, with uname -a​:

Linux kubuntu 4.4.0-122-generic #​146-Ubuntu SMP Mon Apr 23 15​:34​:04 UTC
2018 x86_64 x86_64 x86_64 GNU/Linux.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant