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

A script shows an invalid read in valgrind (and leaks and segfaults) in Rakudo #4361

Open
p6rt opened this issue Jun 29, 2015 · 1 comment
Open
Labels
perf SEGV Segmentation fault, bus error, etc.

Comments

@p6rt
Copy link

p6rt commented Jun 29, 2015

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

Searchable as RT125507$

@p6rt
Copy link
Author

p6rt commented Jun 29, 2015

From @masak

<kanl> i'm a newbie. started playing with perl6 just recently. i wrote
a module with the help of whatever material i can find piecing
together. but it seems to be leaking memory quite badly (by observing
top while it's running). can anyone help take a look at it and tell me
what i'm doing wrong?
<kanl> https://gist.github.com/anonymous/4071a06909f4df8cabb2
<kanl> it's meant to be a piece of system monitoring tool. it runs ok
for a few iterations, and eventually craps out. as i observe top
output, memory seems to be leaking at an alarming rate
<masak> kanl​: we're very happy you supply this real-world example. we
need things exactly like this to be able to polish Rakudo for the
release.
<masak> kanl​: I hope during the day one or more knowledgeable people
will delve into why your program leaks. hopefully it's even an easy
fix.
<masak> threading could be a culprit. so could shelling out to other processes.
<kanl> masak​: glad i can help :) so it's not something i'm not
supposed to by doing that caused whatever problem then? what should i
do next, file a bug?
<RabidGravy> kanl, the general approach is reduce the code to the
absolute minimum required to reproduce the fault and report a bug
<kanl> RabidGravy​: ok, i think i can do that. i can comment out a few
commands, leaving with just one. i was able to reproduce "mem leak"
with running only one command, e.g. df, but it's hard to describe the
problem, because the valgrind output is not consistently pointing to
thread instability.
<kanl> i.e. i'm not getting consistent failure each time :)
<kanl> i'd be glad to file a bug, just i'm not entirely sure what on ..
<RabidGravy> I think "this code leaks memory and eventually SEGVs" is
enough :-) stick it on rt.perl.org (in the perl6 queue)
<RabidGravy> memory leaks are bad, segfaults are very bad
<jnthn> I suspect the EVAL may be the leak cause
<kanl> RabidGravy​: ok, i'll do that, thanks. btw, i initally tried to
implement it with Proc​::Async, but i learned the hard way that
stdout/stderr are not tapped at once in its entirity. so i'd have to
piece together the output with a supply/channel, and that was a pita,
so i gave up. also Proc​::Async doesn't seem to be very stable :p
<RabidGravy> my experience of Proc​::Async is limited to making a few
shoirt examples to document it
<jnthn> kanl​: What version of Rakudo are you running? A bunch of
stability issues got cleared up in the last month or so...
<kanl> This is perl6 version 2015.06-1-gdf0c3a3 built on MoarVM version 2015.06
<jnthn> Ah, that's pretty recent.
<jnthn> The invalid read valgrind spots is certainly a bug
<jnthn> That should never happen.
<kanl> if anyone else in the channel would know better how to describe
the problem i'm having, i'd be glad to yield/defer the bug filing :)
* masak submits rakudobug

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

No branches or pull requests

1 participant