Description of problem: While working on bug 675863, we discovered Perl scripts using threads crash when doing string evals. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [jbastian@sun-x4500-1 ~]$ cat thread-eval.pl #!/usr/bin/perl use threads; threads->create(sub { eval '1' }) for 1..20; print("Waiting for threads to finish\n"); $_->join() foreach (threads->list()); [jbastian@sun-x4500-1 ~]$ ./thread-eval.pl Waiting for threads to finish Segmentation fault ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Perl 5.8.9 fixes it: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [jbastian@sun-x4500-1 ~]$ /home/jbastian/local/bin/perl --version This is perl, v5.8.9 built for x86_64-linux-thread-multi ... [jbastian@sun-x4500-1 ~]$ /home/jbastian/local/bin/perl ./thread-eval.pl Waiting for threads to finish [jbastian@sun-x4500-1 ~]$ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This was reported upstream at http://rt.perl.org/rt3//Public/Bug/Display.html?id=45053 See also http://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=commit&s=45053 And appears to be fixed with these commits: http://perl5.git.perl.org/perl.git/commit/863e9b4aa72b7b080129007c00c2b1efa2a78bca http://perl5.git.perl.org/perl.git/commit/401667e9af6ec282136e4e49614eb18614c5654b Version-Release number of selected component (if applicable): perl-5.8.8-32.el5_5.2 How reproducible: every time Steps to Reproduce: 1. save thread-eval.pl as shown above and run it Actual results: segmentation fault Expected results: no crash Additional info:
We would need update of threads to 1.71 from 1.07 and apply change of op.c from commit http://perl5.git.perl.org/perl.git/commit/401667e9af6ec282136e4e49614eb18614c5654b
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.
Created attachment 518708 [details] newCONTSUB wasn't thread safe This patch fix threads part in perl, but you also need update of threads module at least to 1.71.
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 String evaluation in threads. Consequence String evaluation in threads can produce crash. Fix String evaluation is internally done in non threaded variables and module threads was updated to version 1.79. Result String evaluation do not lead to crashes.
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