Bug 1223045 - glob in threads is broken
Summary: glob in threads is broken
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: perl
Version: 7.1
Hardware: All
OS: All
Target Milestone: rc
: ---
Assignee: Petr Šabata
QA Contact: Martin Kyral
Lenka Špačková
URL: https://rt.perl.org/Public/Bug/Displa...
Depends On:
Blocks: 1203710 1313485 1289025 1295829
TreeView+ depends on / blocked
Reported: 2015-05-19 16:46 UTC by Paulo Andrade
Modified: 2019-06-13 08:31 UTC (History)
5 users (show)

Fixed In Version: perl-5.16.3-287.el7
Doc Type: Release Note
Doc Text:
Perl interpreter no longer crashes when using glob() with a threaded program Previously, when calling the Perl glob() function after spawning a thread, the Perl interpreter terminated unexpectedly with a segmentation fault. An upstream patch has been applied to clone glob() interpreter-wide data, and using Perl glob() with a threaded program now works as expected.
Clone Of:
Last Closed: 2016-11-04 00:15:43 UTC
Target Upstream Version:

Attachments (Terms of Use)
File::Glob: Dup glob state in CLONE() (4.55 KB, patch)
2015-09-02 15:43 UTC, Petr Šabata
no flags Details | Diff

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

Description Paulo Andrade 2015-05-19 16:46:32 UTC
Upstream bug report:

Upstream patch:

For easier visualization, and cut&paste, reproducer
repeated here:

use warnings;
use strict;
use threads;
use threads::shared;
my $nthread = 20;
sub work {
    foreach (1..10000) {
	my @files = <*.supp>;
my @threads;
foreach my $i (1..$nthread) {
    push @threads, threads->create(\&work);
foreach my $t (@threads) {

Comment 3 Petr Šabata 2015-09-02 15:43:33 UTC
Created attachment 1069481 [details]
File::Glob: Dup glob state in CLONE()

Backport of the proposed patch for 5.16.3.

Comment 5 Petr Šabata 2016-03-02 15:04:58 UTC
Pushed as perl-5.16.3-287.el7.

Comment 12 errata-xmlrpc 2016-11-04 00:15:43 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.


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