Skip Menu |

This queue is for tickets about the DBI CPAN distribution.

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

People
Owner: Nobody in particular
Requestors: mmusgrove [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 1.621
  • 1.622
  • 1.622_901
Fixed in: (no value)



Three days agao I asked on dbi-users if anyone has seen segmentation faults with DBI 1.622 when using threads. http://www.nntp.perl.org/group/perl.dbi.users/2012/10/msg36469.html A while back I was having problems with segfaults under an older version of DBI (1.617 IIRC) but that was fixed by bug 77137. Ever since we've still been seeing segfaults, just not as frequently. I've been capturing core dumps and running them through gdb. The backtraces point us to line 3265 in DBI.xs: if ((i = DBIc_DEBUGIV(imp_xxh))) { /* merge handle into global */ I'm using Perl 5.12.3 with DBI 1.622 and DBD::Oracle 1.52. (I've also confirmed that the same issue occurs under 5.14.2 and 5.16.1.) I have also tried it with DBI 1.61 and 1.622_091 and they both suffer the same fate. I'm attaching the latest full backtrace and including the output from perl -V for the copy with debugging symbols. What else can I do to help investigate this issue? Thanks, Matt [root@convnms1 ~]# /opt/perld/perls/perl-5.12.3/bin/perl -V Summary of my perl5 (revision 5 version 12 subversion 3) configuration: Platform: osname=linux, osvers=2.6.18-238.9.1.el5, archname=x86_64-linux-thread-multi uname='linux nmsdev2.efjdfw.local 2.6.18-238.9.1.el5 #1 smp tue apr 12 18:10:13 edt 2011 x86_64 x86_64 x86_64 gnulinux ' config_args='-de -Dprefix=/opt/perld/perls/perl-5.12.3 -Dusethreads -Duselargefiles -Doptimize=-O2 -Doptimize=-g' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-g', cppflags='-D_REENTRANT -D_GNU_SOURCE -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.1.2 20080704 (Red Hat 4.1.2-46)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc', ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64 /usr/local/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=/lib/libc-2.5.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.5' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -g -L/usr/local/lib -fstack-protector' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING MULTIPLICITY PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_TRACK_MEMPOOL USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API Built under linux Compiled at May 10 2012 19:03:35 %ENV: PERLLIB="/opt/nms/lib/perl" @INC: /opt/nms/lib/perl /opt/perld/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux-thread-multi /opt/perld/perls/perl-5.12.3/lib/site_perl/5.12.3 /opt/perld/perls/perl-5.12.3/lib/5.12.3/x86_64-linux-thread-multi /opt/perld/perls/perl-5.12.3/lib/5.12.3 .
Subject: bt.18749
Download bt.18749
application/octet-stream 12.9k

Message body not shown because it is not plain text.

Subject: DBI 1.622 segfaults in DESTROY with threads
I forgot to mention that this is the same threaded daemon that had the DBI issues before. Oh and it appears from the backtrace that it is segfaulting in DESTROY. Updating subject.
If I had a small test case that reproduced the problem then I'd know if DBI was the real culprit. That said, the problem goes away (and all existing test cases still pass) if I change DBI.xs line 3265 to: if (!PL_dirty && (i = DBIc_DEBUGIV(imp_xxh))) { /* merge handle into global */
Hi. Sorry for the delay in replying. Does moving the whole " if ((i = DBIc_DEBUGIV(imp_xxh))) {...}" block down to just below the following #ifdef DBI_USE_THREADS { ... } #ifdef block (without adding the !PL_dirty) also work? Tim.
On Thu Nov 08 07:05:00 2012, TIMB wrote: Show quoted text
> Hi. Sorry for the delay in replying. > > Does moving the whole " if ((i = DBIc_DEBUGIV(imp_xxh))) {...}" block > down to just below the > following #ifdef DBI_USE_THREADS { ... } #ifdef block (without adding > the !PL_dirty) also work? > > Tim.
I've been testing this change all day with 5.16.2 and I haven't seen it segfault or gpf once. I'm going to retest under 5.12.3 and I'll post a reply once I've tested it there.
On Thu Nov 08 07:05:00 2012, TIMB wrote: Show quoted text
> Hi. Sorry for the delay in replying. > > Does moving the whole " if ((i = DBIc_DEBUGIV(imp_xxh))) {...}" block > down to just below the > following #ifdef DBI_USE_THREADS { ... } #ifdef block (without adding > the !PL_dirty) also work? > > Tim.
I didn't has as many distractions this afternoon so I was able to get it tested under 5.12.3 much quicker than I did under 5.16.2. The suggested change works greats for me. Thanks Tim!
Fixed in r15476. Thanks.