Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 48393
Status: resolved
Priority: 0/
Queue: DBD-SQLite

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

Bug Information
Severity: (no value)
Broken in:
  • 1.23
  • 1.24_01
  • 1.24_02
  • 1.25
  • 1.26_01
  • 1.26_02
Fixed in: (no value)



Subject: Error on commit when running under the debugger: "panic: attempt to copy freed scalar"
Download (untitled) / with headers
text/plain 3.2k
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
Download (untitled) / with headers
text/plain 3.9k
Thanks for the report. I confirmed the error. With a brief testing, I found that turning AutoCommit to 0 and commenting out the ->begin_work line made the script work without problems. Actually DBD::SQLite does some tricks to begin transaction internally, so we might possibly need to wrap default begin_work. Anyway, I'll look at this issue further later. Kenichi Ishigaki On Monday Aug 03 10:19:20 2009, JSIRACUSA wrote: Show quoted text
> 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" Show quoted text
> 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: Show quoted text
> 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 Show quoted text
> 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 Show quoted text
> -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 Show quoted text
> 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' Show quoted text
> 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 Show quoted text
> 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 >
Download (untitled) / with headers
text/plain 3.7k
As of 1.26_04, this should be fixed. An optional test is included in the distribution. Set TEST_DBD_SQLITE_WITH_DEBUGGER to true if you want to test this. If you still have the problem, please reopen this. Thanks, Kenichi On Mon Aug 03 10:19:20 2009, JSIRACUSA wrote: Show quoted text
> 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" Show quoted text
> 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: Show quoted text
> 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 Show quoted text
> 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 Show quoted text
> -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 Show quoted text
> 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' Show quoted text
> 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 Show quoted text
> 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 >


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.