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
Bugfix for memory leak [rt.cpan.org #57990] #86
Comments
updated patch again for the latest version:
|
We are running into this memory leak issue at work, it would be great if the patch could be merged and a new fixed version released. I've also tested that the test suite does not fail with the latest version of the patch. |
Ping, any chance this could be merged? |
A pull request was outstanding to look at test results. Ideally I'd like a test that shows this problem. Not sure do that at this time. |
@pabs3 I'm 90% certain the issue is that you can't just blanket clear FILTERS. First of all it's a array ref so you need to set it back to that not undef. But more importantly it looks like you need to re-set it to whatever was passed into new. To be honest it almost looks like you can't count on cleanup to work right WRT filters. I'll have to look at this later. |
Actually I don't think the bug is what you think it is. There's a known problem with autovivification of Scalar SVs when the reference to them is passed in and then later set in a subroutine. The refcount is never sufficiently reduced. |
I'm not the author of the patch, I think you should be pinging @kbucheli or someone else. |
The current PR is rather different from my original patch (which we use in production). As it is now in Github, I created now a PR for my patch: #115 |
Does #115 merged in master fix your problem? Be aware that newer Perls leak more slowly because of COW |
I tested with this modified code, using Devel::Peek. I could see the COW refcount going up and the SV addresses changing every iteration. I assume that means that every loop was causing a new PAD to get created which probably fails at some point not just running out of memory. Now with #115 it's not happening so I think we're good to merge for now. use IPC::Run ();
use Devel::Peek;
while (1) {
sleep 1;
my $stdin = '';
my $stdout = '';
my $stderr = '';
eval { IPC::Run::run( ["ls"], \$stdin, \$stdout, \$stderr ) };
die $@ if $@;
Dump( $stdin);
Dump( $stdout);
Dump( $stderr);
} |
Another bugfix for memory leak [rt.cpan.org #57990] #86
Merged. |
Migrated from rt.cpan.org#57990 (status was 'open')
Requestors:
Attachments:
From akobernik@iponweb.net on 2010-05-31 10:51:07:
Most probably, the ticket is a duplicate of Bug #13660.
Distribution name and version: IPC-Run-0.89
Perl version: v5.10.1 (*) built for i486-linux-gnu-thread-multi
Operating System vendor and version: Linux finland 2.6.32-trunk-686 #1
SMP Sun Jan 10 06:32:16 UTC 2010 i686 GNU/Linux
How to reproduce the memory leak:
Patch:
(found here:
http://download2.3tera.net/oss/files/osm/perl-IPC-Run-0.80-2/IPC-Run-mem-leak.patch)
--
Alexander O. Kobernik
From toddr@cpan.org on 2012-08-22 12:48:45:
The internals seem a little dodgy if this is a safe or appropriate thing to do. There's not
spectacular documentation on the _cleanup subroutines.
What I do know is that the patch breaks the test suite ATM....
From tom@embt.com on 2012-10-09 00:05:16:
FWIW, this is a solution I'm trying locally and tests do pass. I tried
the other patch but it seems to prevent rerunning a harness. I can't
say for certain if this change is safe, I am not familiar with all of
the IPC::Run internals.
The text was updated successfully, but these errors were encountered: