Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 537777 - 'Attempt to free unreferenced scalar' when running a perl program with threads
'Attempt to free unreferenced scalar' when running a perl program with threads
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: perl (Show other bugs)
5.4
All Linux
high Severity high
: rc
: ---
Assigned To: perl-maint-list
Petr Šplíchal
: ZStream
Depends On:
Blocks: 629935
  Show dependency treegraph
 
Reported: 2009-11-16 05:46 EST by Issue Tracker
Modified: 2018-10-27 10:02 EDT (History)
7 users (show)

See Also:
Fixed In Version: perl-5.8.8-28.el5
Doc Type: Bug Fix
Doc Text:
Cause Joining or undefining a thread variable (using undef) in a perl program results in an internal perl error. Consequence Error message on stderr: Attempt to free unreferenced scalar: SV 0x7b5a840, Perl interpreter: 0x7a1e2f0 during global destruction. Fix Backport of upstream patch fixed perl internals. Result The internal error do not show up.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-02-21 00:39:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
backport of upstream patch (582 bytes, patch)
2009-11-16 05:47 EST, Martin Poole
no flags Details | Diff


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0199 normal SHIPPED_LIVE perl bug fix update 2012-02-20 09:54:01 EST

  None (edit)
Description Issue Tracker 2009-11-16 05:46:27 EST
Escalated to Bugzilla from IssueTracker
Comment 1 Issue Tracker 2009-11-16 05:46:30 EST
Event posted on 2009-11-14 07:29 GMT by spoyarek

Base OS: RHEL-5.4

Problem Description:

Joining or undefining a thread variable (using undef) in a perl program results in an internal perl error:
Attempt to free unreferenced scalar: SV 0x7b5a840, Perl interpreter: 0x7a1e2f0 during global destruction.

How Reproducible:

Always

Steps to Reproduce:

$ cat test.pl
#!/usr/bin/perl

use threads;

my $subref = sub { 42; };

my $t;

while(1) {
    $t=threads->new($subref);
    $t->join();
}

$ perl test2.pl

Actual Result:

Attempt to free unreferenced scalar: SV 0x7b7dcb0, Perl interpreter: 0x7b4cfb0 during global destruction.
Attempt to free unreferenced scalar: SV 0x7b7e1e0, Perl interpreter: 0x7b4cfb0 during global destruction.
.
.

Expected Result:

The internal error should not show up.
 
Additional Information:

An upstream patch is available, which fixes this:

http://perl5.git.perl.org/perl.git/commitdiff/dd5ef8e06fad97042101d2f0784676bb2111654b

I have attached a patch adapted to RHEL-5. I have tested it to verify that it works. Would like a review of the patch so that I can give a test package to the customer to verify.
This event sent from IssueTracker by mpoole  [Support Engineering Group]
 issue 365873
Comment 2 Martin Poole 2009-11-16 05:47:59 EST
Created attachment 369666 [details]
backport of upstream patch
Comment 3 Martin Poole 2009-11-16 05:52:22 EST
Reproducer can be reduced to

#!/usr/bin/perl

use threads;

my $subref = sub { 42; };

my $t=threads->new($subref);
$t->join();
Comment 4 Marcela Mašláňová 2009-11-16 07:20:13 EST
The patch looks all right.
Comment 7 RHEL Product and Program Management 2010-08-09 14:55:39 EDT
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
Comment 18 Marcela Mašláňová 2011-09-26 03:23:39 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause
    Joining or undefining a thread variable (using undef) in a perl program results in an internal perl error.
Consequence
    Error message on stderr: Attempt to free unreferenced scalar: SV 0x7b5a840, Perl interpreter: 0x7a1e2f0
during global destruction.
Fix
    Backport of upstream patch fixed perl internals.
Result
    The internal error do not show up.
Comment 20 errata-xmlrpc 2012-02-21 00:39:33 EST
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.

http://rhn.redhat.com/errata/RHBA-2012-0199.html

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