Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

Report information
The Basics
Id: 77137
Status: resolved
Priority: 0/
Queue: DBI

People
Owner: Nobody in particular
Requestors: rok [...] open.ch
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.620
Fixed in: 1.616



Subject: DBI 1.620 causes segfault in Perl when used with module Thread::Pool::Simple.
I am using Perl version 5.14 on Linux 2.6.32.52_1-osix-3466 (custom Linux distribution from LFS) with DBI version 1.620 as well as version 0.25 of the module Thread::Pool::Simple (from CPAN). The module Thread::Pool::Simple does not include any XS code, and itself uses only the modules Carp, Storable, Thread::Queue and Thread::Semaphore. These are all included in the Perl distribution as of Perl 5.14 and possibly also earlier versions. The attached script causes a segmentation fault in Perl without any Perl-specific error messages being generated. It is only necessary to include the DBI module with a use statement in order to trigger the segfault, creating a database handle is not necessary. Conversely, removing the use statement causes the script to work as expected. Version 1.620 of DBI causes this issue, while 1.616 does not. Based on the changes document on the DBI CPAN page, the following changes appear to be potential candidates for the introduction of this problem: In 1.617: Enhanced performance for threaded perls (Dave Mitchell, Tim Bunce) In 1.618: Significantly optimized DBI internals for threads (Dave Mitchell) Xsub to xsub calling optimization now enabled for threaded perls. If it is necessary to contact me, please Cc the email to the following addresses: dws@open.ch fh@open.ch ras@open.ch As I will not be available until next Friday. Thanks for your attention, Rowan Klöti Open Systems AG
Subject: test-segfault.pl
#!/usr/bin/env perl use strict; use warnings; use lib '/shared/rok/OSAGera/lib'; use lib '/opt/OSAGora/cpan'; use DBI; use Thread::Pool::Simple; sub _process_job { (my $value) = @_; return 2 * $value; } my $pool = Thread::Pool::Simple->new( min => 1, max => 10, load => 1/10, do => [ \&_process_job, ], ); my @values = (1..10); print "In: @values\n"; my @job_ids = map { $pool->add($_) } @values; $pool->join(); my @results = map { $pool->remove($_) } @job_ids; print "Out: @results\n";
On Fri May 11 10:41:10 2012, rok wrote: Show quoted text
> I am using Perl version 5.14 on Linux 2.6.32.52_1-osix-3466 (custom > Linux distribution from LFS) with DBI version 1.620 as well as version > 0.25 of the module Thread::Pool::Simple (from CPAN). > > The module Thread::Pool::Simple does not include any XS code, and itself > uses only the modules Carp, Storable, Thread::Queue and > Thread::Semaphore. These are all included in the Perl distribution as of > Perl 5.14 and possibly also earlier versions. > > The attached script causes a segmentation fault in Perl without any > Perl-specific error messages being generated. > > It is only necessary to include the DBI module with a use statement in > order to trigger the segfault, creating a database handle is not > necessary. Conversely, removing the use statement causes the script to > work as expected. > > Version 1.620 of DBI causes this issue, while 1.616 does not. Based on > the changes document on the DBI CPAN page, the following changes appear > to be potential candidates for the introduction of this problem: > > In 1.617: > Enhanced performance for threaded perls (Dave Mitchell, Tim Bunce) > > In 1.618: > Significantly optimized DBI internals for threads (Dave Mitchell) > Xsub to xsub calling optimization now enabled for threaded perls. > > If it is necessary to contact me, please Cc the email to the following > addresses: > dws@open.ch > fh@open.ch > ras@open.ch > As I will not be available until next Friday. > > Thanks for your attention, > Rowan Klöti > Open Systems AG
I have a similar issue but I have been having trouble reducing it down to a small test case. http://www.mail-archive.com/dbi-users@perl.org/msg34355.html
If you get the version from subversion trunk (see DBI docs) it has a potential fix for this problem. Could you please try it out and get back to us. Thanks. Martin -- Martin J. Evans Wetherby, UK
On Mon May 14 04:18:44 2012, MJEVANS wrote: Show quoted text
> If you get the version from subversion trunk (see DBI docs) it has a > potential fix for this problem. Could you please try it out and get back > to us. > > Thanks. > > Martin
A big thank you to Dave Mitchell for the patch and to you Martin for applying it and telling us about it. The new version certainly fixes my problem! I hope it works for Rowan as well.
From: rok [...] open.ch
Thanks to everyone for your help. I am unfortunately not in a position to deploy the fix in its current state to test it, but I will reply as soon as I can verify that the fix is working for me.
From: rok [...] open.ch
On Fri May 18 03:06:42 2012, rok wrote: Show quoted text
> Thanks to everyone for your help. I am unfortunately not in a position > to deploy the fix in its current state to test it, but I will reply as > soon as I can verify that the fix is working for me.
I have now managed to verify that the patch fixes the issue, i.e. the test case no longer segfaults. Thanks for your fast response.
Patched and uploaded for testing in DBI-1.620_901.tar.gz
Released in 1.621. Thanks!