Skip Menu |
 

This queue is for tickets about the Data-Alias CPAN distribution.

Report information
The Basics
Id: 82922
Status: resolved
Priority: 0/
Queue: Data-Alias

People
Owner: Nobody in particular
Requestors: florent.angly [...] gmail.com
Cc:
AdminCc:

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



Subject: Segfault when using threads
Download (untitled) / with headers
text/plain 629b
When using threads and Method::Signatures, I sometimes run into segfaults. This has happened to me twice, in different scripts and contexts. Here is a small example that segfaults: #! /usr/bin/env perl use strict; use warnings; use threads; use Method::Signatures; my $thr = threads->create(\&worker); $thr->join(); exit; sub worker { my $path = 'Bio/Phylo/Parsers/Newick.pm'; require $path; return 1; } Note that when uncommenting the line 'use Method::signatures;', the script runs fine. Best, Florent Method::Signatures 20120523 perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
Subject: Re: [rt.cpan.org #82922] Segfault when using threads
Date: Sat, 26 Jan 2013 10:05:45 -0800
To: bug-Method-Signatures [...] rt.cpan.org
From: "Michael G. Schwern" <schwern [...] pobox.com>
Download (untitled) / with headers
text/plain 828b
On 1/23/13 7:04 PM, Florent Angly via RT wrote: Show quoted text
> Note that when uncommenting the line 'use Method::signatures;', the > script runs fine.
I can replicate. I reduced it down to a problem with eval STRING + threads + Method::Signatures. Even if Method::Signatures is loaded in a different scope and package. Loading Devel::Declare or MooseX::Method::Signatures doesn't cause a problem, so I tried a few modules that Method::Signatures loads. The problem is Data::Alias. #! /usr/bin/env perl use strict; use warnings; use threads; use Data::Alias; my $thr = threads->create(\&worker); $thr->join(); exit; sub worker { eval "1 + 1"; return 1; } I'm going to kick this over to the Data::Alias queue. I'll mitigate the problem by only loading Data::Alias if necessary.
Fixed in Data-Alias-1.18, now on CPAN.
RT-Send-CC: schwern [...] pobox.com, zefram [...] fysh.org
Alas, it would appear that t/thread-bug.t results in a segfaulting test upon program exit ("Non-zero wait status: 11"), which causes Method::Signatures to fail to install on what appears to be any threaded perl. For example: http://www.cpantesters.org/cpan/report/54c0005e-90e4-11e3-8f3c-fc23d5af1b80 The tests themselves complete successfully, but perl seems to segfault on exit. That means we can't even mark them as TODO tests to avoid bail-outs on module install. Oddly enough, this seems to happen even when Data::Alias is not installed. (I just tested on Perl 5.14.2 on both 32 and 64-bit Ubuntu 13.10.) This would also be why the 20131010 release on the CPAN has so many failures logged against it. http://www.cpantesters.org/distro/M/Method-Signatures.html?oncpan=1&distmat=1&version=20131010 Given Method::Signatures is so darn cool, and threaded Perls are so common, is there any chance we can flip thread-bug.t to be an author-only test for the moment? I'm happy to submit a pull request. Many thanks! Paul
Download (untitled) / with headers
text/plain 118b
Also worth noting when inspecting the test reports that a wait status of 139 is 128 (coredump) + signal 11 (SEGFAULT).


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.