Subject: | Error on commit when running under the debugger: "panic: attempt to copy freed scalar" |
I get a fatal error when running under the debugger and passing over a
commit() call using DBD::SQLite 1.25, 1.26_02, 1.26_01, 1.24_02,
1.24_01, 1.23, and probably earlier versions as well.
Below is a script to reproduce the bug. Run it with "perl -d script.pl"
and then either just type "c" to continue or type "n" and then hit
return repeatedly to step until you pass over the commit() call.
The error message is:
"panic: attempt to copy freed scalar 94d410 to 849ac0 at
/usr/local/lib/perl5/5.10.0/perl5db.pl line 3733."
The script:
---
use DBI;
my $db_file = 'test.db';
unlink($db_file);
die "Could not delete $db_file - $!" if(-e $db_file);
my $dbh = DBI->connect("dbi:SQLite:dbname=$db_file", undef, undef, {
RaiseError => 1, AutoCommit => 1 });
$dbh->do('CREATE TABLE t1 (id int)');
$dbh->begin_work or die $dbh->errstr;
my $sth = $dbh->prepare('INSERT INTO t1 (id) VALUES (1)');
$sth->execute;
# XXX: Panic occurs here when running under the debugger
$dbh->commit or die $dbh->errstr;
---
My environment:
% uname -a
Darwin Derkins.local 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31
22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386
% perl -V
Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
Platform:
osname=darwin, osvers=9.2.2, archname=darwin-2level
uname='darwin derkins.local 9.2.2 darwin kernel version 9.2.2: tue
mar 4 21:17:34 pst 2008; root:xnu-1228.4.31~1release_i386 i386 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=undef, use64bitall=undef, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp
-fno-strict-aliasing -pipe -I/usr/local/include -fno-common
-DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe
-I/usr/local/include'
ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)',
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup
-L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: PERL_DONT_CREATE_GVSV PERL_MALLOC_WRAP
USE_LARGE_FILES USE_PERLIO
Built under darwin
Compiled at Apr 14 2008 15:19:10
%ENV:
PERL_READLINE_NOWARN=""
PERL_RL=" o=0"
@INC:
/usr/local/lib/perl5/5.10.0/darwin-2level
/usr/local/lib/perl5/5.10.0
/usr/local/lib/perl5/site_perl/5.10.0/darwin-2level
/usr/local/lib/perl5/site_perl/5.10.0