Skip Menu |
Report information
Id: 125507
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



To: rakudobug [...] perl.org
Subject: [BUG] A script shows an invalid read in valgrind (and leaks and segfaults) in Rakudo
From: Carl Mäsak <cmasak [...] gmail.com>
Date: Mon, 29 Jun 2015 10:24:28 +0200
Download (untitled) / with headers
text/plain 2.7k
<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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org