View Issue Details

IDProjectCategoryView StatusLast Update
0015966CentOS-7perlpublic2019-03-28 13:50
ReporterAnton.Suslov 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
PlatformDockerOSCentOSOS Version7
Product Version7.6.1810 
Target VersionFixed in Version 
Summary0015966: Perl 5.16.3 leaks memory in a custom die handler
DescriptionA memory leak was noticed in a mod_perl application using HTML::Mason. Upon closer inspection, the culprit turned out to be HTML::Mason::Exceptions::rethrow_exception, a die handler. But this issue does not reproduce under other Perl versions (tried 5.10, 5.22, 5.28), so it seems to be an issue in the Perl itself. That means that bundled mod_perl is affected as well. Of course, there is a solution to just build mod_perl and perl ourselves, but that also carries some stability implications.
Steps To ReproduceDockerfile:

FROM centos:7
RUN yum install -y perl perl-App-cpanminus gcc
RUN cpanm -i HTML::Mason
ADD leak.pl /tmp

leak.pl
use HTML::Mason::Exceptions;

use Carp;
use strict;
use warnings;

$SIG{__DIE__} = \&HTML::Mason::Exceptions::rethrow_exception;

sub leaky_stuff {
    eval {
        my $r = rand(1);
        die "error: $r";
    }
}

while (1) {
    leaky_stuff;
}

Run leak.pl in the container, and it will steadily increase the memory used. Other versions of Perl are not affected, the script quickly stops consuming extra memory.
Tagsmemory, perl
abrt_hash
URL

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2019-03-28 13:50 Anton.Suslov New Issue
2019-03-28 13:50 Anton.Suslov Tag Attached: memory
2019-03-28 13:50 Anton.Suslov Tag Attached: perl