Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1063330 - memory leak when including a file with "use utf8"
Summary: memory leak when including a file with "use utf8"
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: perl-maint-list
QA Contact: Martin Kyral
URL: https://rt.perl.org/Public/Bug/Displa...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-10 14:11 UTC by Petr Pisar
Modified: 2016-11-04 00:15 UTC (History)
4 users (show)

Fixed In Version: perl-5.16.3-288.el7
Doc Type: Bug Fix
Doc Text:
Cause: Including file with "use utf8" Consequence: When perl includes a file with "use utf8" and text constants it leaks memory. Fix: Upstream fix that the temp utf8 copy of namepv is correctly freeing. Result: Including "use utf8" and constant does not leak.
Clone Of: 1062576
Environment:
Last Closed: 2016-11-04 00:15:38 UTC
Target Upstream Version:


Attachments (Terms of Use)
Upstream fix applicable to 5.16.3 (deleted)
2015-10-27 16:03 UTC, Petr Pisar
no flags Details | Diff


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2191 normal SHIPPED_LIVE perl bug fix update 2016-11-03 13:19:19 UTC

Description Petr Pisar 2014-02-10 14:11:58 UTC
+++ This bug was initially created as a clone of Bug #1062576 +++

Description of problem:
Every time perl includes a file with "use utf8" and text constants it leaks memory.


Version-Release number of selected component (if applicable):
perl-5.16.3-266.fc19.x86_64

How reproducible:
always

Steps to Reproduce:
1. run the test program below
2. watch as memory usage grows

Here is the test program:
-------------------------
my $mem = 0;
sub report_memory () {
        my $next_mem = qx[ps -p $$ -o size=]+0;
        printf "%+8d = %8d K\n", $next_mem-$mem, $next_mem; $mem = $next_mem;
}

for (0..1e5) {
        do 'x.inc';
        report_memory unless $_ % 1e4;
}
-------------------------

x.inc contains:
-------------------------
use utf8;
$x='x';
-------------------------

--- Additional comment from Petr Pisar on 2014-02-10 13:49:09 GMT ---

Upstream report <https://rt.perl.org/Public/Bug/Display.html?id=121200>.

--- Additional comment from Petr Pisar on 2014-02-10 14:09:35 GMT ---

All Fedoras are affected (confirmed on perl-5.18.2-296.fc21.x86_64, perl-5.18.2-289.fc20.x86_64, perl-5.16.3-266.fc19.x86_64).
------

RHEL-7 is affected (perl-5.16.3-283.el7.x86_64).

Comment 3 Petr Pisar 2015-10-27 16:03:05 UTC
Created attachment 1086911 [details]
Upstream fix applicable to 5.16.3

Comment 7 Jitka Plesnikova 2016-03-03 14:50:17 UTC
How reproduce:

1) Install perl

2) Create test data file 
x.inc contains:
-------------------------
use utf8;
$x='x';
-------------------------

3) Create the test program:
-------------------------
my $mem = 0;
sub report_memory () {
        my $next_mem = qx[ps -p $$ -o size=]+0;
        printf "%+8d = %8d K\n", $next_mem-$mem, $next_mem; $mem = $next_mem;
}

for (0..1e5) {
        do 'x.inc';
        report_memory unless $_ % 1e4;
}
-------------------------

4) Run the test and watch the memory usage

Comment 10 errata-xmlrpc 2016-11-04 00:15:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2191.html


Note You need to log in before you can comment on or make changes to this bug.