Subject: | "threads->create" does a "Segmentation fault: 11" with "use open IO :std" |
Date: | Sun, 3 Nov 2013 17:49:02 +0100 |
To: | bug-threads [...] rt.cpan.org |
From: | "G. & W. Husmann" <cpan.w.husmann [...] spamgourmet.com> |
Please find the complete information in the attached perl source file. For your convenience I paste its contents here:
#! perl
# Bug Report: "threads->create" does a "Segmentation fault: 11" with "use open IO :std"
# Wolfgang Husmann, cpan.w.husmann@spamgourmet.com, 2013-11-03T17:43:38.319-01:00
use v5.14;
use strict;
use utf8;
use warnings FATAL => qw( all );
use open IO => qw( :encoding(utf-8-strict) :std );
# ^^^^---- remove this and threads->create works
use threads;
INIT {
use Config;
$Config{'useithreads'} or die 'Recompile Perl with threads to run this program.';
}
sub worker {
say 'B';
};
say 'A';
my $thread = threads->create('worker');
say 'C';
__END__
navel:HusmannDemosPerl husparents$ perl -v
=> This is perl 5, version 18, subversion 1 (v5.18.1) built for darwin-thread-multi-2level
Copyright 1987-2013, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
navel:HusmannDemosPerl husparents$ cpanm -v threads
=> cpanm (App::cpanminus) 1.7001 on perl 5.018001 built for darwin-thread-multi-2level
Work directory is /Users/husparents/.cpanm/work/1383497065.11992
You have make /usr/bin/make
You have /usr/local/bin/wget
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching threads on cpanmetadb ...
--2013-11-03 17:44:25-- http://cpanmetadb.plackperl.org/v1.0/package/threads
Auflösen des Hostnamen »cpanmetadb.plackperl.org«.... 185.31.16.192
Verbindungsaufbau zu cpanmetadb.plackperl.org|185.31.16.192|:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 62 [text/x-yaml]
In »STDOUT« speichern.
100%[==============================================================================================================================================================================================================>] 62 --.-K/s in 0s
2013-11-03 17:44:26 (4,93 MB/s) - »-« gespeichert [62/62]
=> threads is up to date. (1.89)
navel:HusmannDemosPerl husparents$ perl threads_vs_open_io_std.pl
A
=> Segmentation fault: 11
navel:HusmannDemosPerl husparents$
Please find the complete information in the attached perl source file. For your convenience I paste its contents here:
#! perl
# Bug Report: "threads->create" does a "Segmentation fault: 11" with "use open IO :std"
# Wolfgang Husmann, cpan.w.husmann@spamgourmet.com, 2013-11-03T17:43:38.319-01:00
use v5.14;
use strict;
use utf8;
use warnings FATAL => qw( all );
use open IO => qw( :encoding(utf-8-strict) :std );
# ^^^^---- remove this and threads->create works
use threads;
INIT {
use Config;
$Config{'useithreads'} or die 'Recompile Perl with threads to run this program.';
}
sub worker {
say 'B';
};
say 'A';
my $thread = threads->create('worker');
say 'C';
__END__
navel:HusmannDemosPerl husparents$ perl -v
=> This is perl 5, version 18, subversion 1 (v5.18.1) built for darwin-thread-multi-2level
Copyright 1987-2013, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
navel:HusmannDemosPerl husparents$ cpanm -v threads
=> cpanm (App::cpanminus) 1.7001 on perl 5.018001 built for darwin-thread-multi-2level
Work directory is /Users/husparents/.cpanm/work/1383497065.11992
You have make /usr/bin/make
You have /usr/local/bin/wget
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
Searching threads on cpanmetadb ...
Auflösen des Hostnamen »cpanmetadb.plackperl.org«.... 185.31.16.192
Verbindungsaufbau zu cpanmetadb.plackperl.org|185.31.16.192|:80... verbunden.
HTTP Anforderung gesendet, warte auf Antwort... 200 OK
Länge: 62 [text/x-yaml]
In »STDOUT« speichern.
100%[==============================================================================================================================================================================================================>] 62 --.-K/s in 0s
2013-11-03 17:44:26 (4,93 MB/s) - »-« gespeichert [62/62]
=> threads is up to date. (1.89)
navel:HusmannDemosPerl husparents$ perl threads_vs_open_io_std.pl
A
=> Segmentation fault: 11
navel:HusmannDemosPerl husparents$
Message body is not shown because sender requested not to inline it.