Skip Menu |

This queue is for tickets about the threads CPAN distribution.

Report information
The Basics
Id: 90019
Status: rejected
Priority: 0/
Queue: threads

People
Owner: Nobody in particular
Requestors: cpan.w.husmann [...] spamgourmet.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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 ...
        --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$



Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #90019] "threads->create" does a "Segmentation fault: 11" with "use open IO :std"
Date: Sun, 3 Nov 2013 12:35:09 -0500
To: bug-threads [...] rt.cpan.org, pp <perl5-porters [...] perl.org>
From: "Jerry D. Hedden" <jdhedden [...] cpan.org>
I have simplified this further: #!/usr/bin/perl use threads; use open IO => qw( :encoding(utf-8-strict) :std ); threads->create(sub {})->join(); If either of ":encoding(utf-8-strict)" or ":std" is removed, then a segfault does not occur. I am posting this to perl5-porters as I suspect this a problem beyond the "threads" module. On Sun, Nov 3, 2013 at 11:49 AM, G. & W. Husmann via RT <bug-threads@rt.cpan.org> wrote: Show quoted text
> Sun Nov 03 11:49:19 2013: Request 90019 was acted upon. > Transaction: Ticket created by cpan.w.husmann@spamgourmet.com > Queue: threads > Subject: "threads->create" does a "Segmentation fault: 11" with "use open IO :std" > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: cpan.w.husmann@spamgourmet.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=90019 > > > > 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$ > > > >
CC: bug-threads [...] rt.cpan.org, pp <perl5-porters [...] perl.org>
Subject: Re: [rt.cpan.org #90019] "threads->create" does a "Segmentation fault: 11" with "use open IO :std"
Date: Sun, 3 Nov 2013 18:55:31 +0100
To: "Jerry D. Hedden" <jdhedden [...] cpan.org>
From: Leon Timmermans <fawaka [...] gmail.com>
On Sun, Nov 3, 2013 at 6:35 PM, Jerry D. Hedden <jdhedden@cpan.org> wrote: Show quoted text
> I have simplified this further: > > #!/usr/bin/perl > use threads; > use open IO => qw( :encoding(utf-8-strict) :std ); > threads->create(sub {})->join(); > > If either of ":encoding(utf-8-strict)" or ":std" is removed, then a > segfault does not occur. > > I am posting this to perl5-porters as I suspect this a problem beyond > the "threads" module. >
This is a known bug, #31923. I wish I could say solving it was easy, though I have some ideas on how to approach that. Leon
Closing this ticket. Here is the link to the perl bug report: https://rt.perl.org/Public/Bug/Display.html?id=31923