Skip Menu |

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

Report information
The Basics
Id: 47874
Status: resolved
Priority: 0/
Queue: DBD-mysql

People
Owner: Nobody in particular
Requestors: matt.lawrence [...] virgin.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 4.005
  • 4.011
Fixed in: (no value)



Subject: $dbh->commit under debugger hangs indefinitely
A simple test case, just begin and commit a transaction: use DBI; my $dbh = DBI->connect('dbi:mysql:...', ...); $dbh->begin_work or die $dbh->errstr; $dbh->commit or die $dbh->errstr; this works fine when run normally, but in the perl debugger it hangs indefinitely on the commit call, and won't even respond to Ctrl-C. This doesn't happen with DBD::Pg, so it would seem to be a problem in DBD::mysql, rather than DBI itself. I've replicated this on version 4.005 under linux, with a threading perl-5.8.8 and on version 4.011 under freebsd with a non-threading perl-5.8.8. I'll send the perl -V output for either system on request.
No more hang, but I do get this with a slightly more complex version of the code: Enter h or `h h' for help, or `man perldebug' for more help. main::(./blah2.pl:5): my $dbh = DBI->connect("DBI:mysql:test", "xxxx", "xxxx"); DB<1> n main::(./blah2.pl:7): $dbh->do("drop table if exists t1"); DB<1> n main::(./blah2.pl:8): $dbh->begin_work or die $dbh->errstr; DB<1> n main::(./blah2.pl:10): $dbh->do("create table t1 (a int) engine=innodb"); DB<1> n main::(./blah2.pl:11): $dbh->do("insert into t1 values (123456789)"); DB<1> n main::(./blah2.pl:13): $dbh->commit or die $dbh->errstr; DB<1> s panic: attempt to copy freed scalar 13077d0 to d71890 at /usr/share/perl/5.14/perl5db.pl line 3737. at /usr/share/perl/5.14/perl5db.pl line 3737 DBI::CODE(0x1060768)(/usr/lib/perl5/DBI.pm:514): 514: return unless defined &DBI::trace_msg; # return unless bootstrap'd ok DB<1> On Tue Jul 14 12:05:44 2009, MATTLAW wrote: Show quoted text
> A simple test case, just begin and commit a transaction: > > use DBI; > my $dbh = DBI->connect('dbi:mysql:...', ...); > $dbh->begin_work or die $dbh->errstr; > $dbh->commit or die $dbh->errstr; > > this works fine when run normally, but in the perl debugger it hangs > indefinitely on the commit call, and won't even respond to Ctrl-C. This > doesn't happen with DBD::Pg, so it would seem to be a problem in > DBD::mysql, rather than DBI itself. > > I've replicated this on version 4.005 under linux, with a threading > perl-5.8.8 and on version 4.011 under freebsd with a non-threading > perl-5.8.8. I'll send the perl -V output for either system on request.
I should see what other drivers give for this as well.
I'm also seeing this error on perl 5.14 (standard centos 6.3 build) with DBD::mysql versions 4.021 and 4.029. It only happens when you try to *examine* the return value from commit. Any kind of comparison or assignment anywhere in the call stack will trigger the error. If you ignore the return value from commit, then it all works fine. $ cat test-err.pl use warnings; use strict; use DBI; my ($connectstr, $username, $password) = @ARGV; my $dbh = DBI->connect($connectstr, $username, $password, {}); $dbh->begin_work; my $sth = $dbh->prepare('insert into kgtest set body=?') || die $dbh->errstr; $sth->execute('kgtesting text body') || die $dbh->errstr; print "PostingID is ". $sth->{'mysql_insertid'}."\n"; print "about to commit...\n"; my $rc = $dbh->commit; print "done committing...\n"; $ ./test-err.sh Loading DB routines from perl5db.pl version 1.33 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(test-err.pl:7): my ($connectstr, $username, $password) = @ARGV; DB<1> c about to commit... panic: attempt to copy freed scalar 2244548 to 1c08278 at /usr/share/perl5/perl5db.pl line 3737. at /usr/share/perl5/perl5db.pl line 3737 Debugged program terminated. Use q to quit or R to restart, use o inhibit_exit to avoid stopping after program termination, h q, h R or h o to get additional info.
After further investigation, it looks like the "attempt to copy freed scalar" but was filed as a perl debugger bug under perl, see https://rt.perl.org/Ticket/Display.html?id=113644. I suspect this DBD::mysql ticket can be closed in favor of that one.
Closing, as suggested.