Skip Menu |

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

Report information
The Basics
Id: 39866
Status: rejected
Priority: 0/
Queue: DBD-mysql

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

Bug Information
Severity: Critical
Broken in:
  • 4.007
  • 4.008
Fixed in: (no value)



Subject: segfault on mysql_ping
Hi, I would like to report information about this problem (see also http://bugs.mysql.com/bug.php?id=36810). Using RT on Debian lenny, and fastcgi, we encouter sometimes this problem (the fastcgi process segfault). It's in the DBD::mysql ping function, here are the steps I used to reproduce it: - set low timeout in my.cnf (10s) - start the app (RT) * I show a first connect and ping - wait for timeout using SHOW FULL PROCESSLIST - connect to the app * works fine, RT reconnects, ping works, adding debug in mysql_db_reconnect function I see that "imp_dbh->auto_reconnect" is false and so there is no automatic reconnect from DBD, but RT has code to do it and does it. - wait timeout another time - reconnect to the app * mysql_db_reconnect detect now that auto_reconnect is on (why???) try to reconnect, return TRUE, then the next call to mysql_ping in the DBD::mysql ping function segfault. Please don't hesitate to ask if you need more debugging to solve this :)
On Tue Oct 07 11:38:43 2008, ELACOUR wrote: Show quoted text
> It's in the DBD::mysql ping function, here are the steps I used to > reproduce it:
Here's a simpler way to reproduce it. Run the attached program :)
#!/usr/bin/perl -w use strict; use warnings; use DBI; my ($host, $database, $username, $password) = @ARGV; die "Usage: $0 host database username password\n" unless $password; my $dbh = DBI->connect("DBI:mysql:database=$database;host=$host", $username, $password); die "Connection failed " . DBI->errstr() unless $dbh; $dbh->{mysql_auto_reconnect} = 1; my $threadid = $dbh->{mysql_thread_id}; my $dbh2 = DBI->connect("DBI:mysql:database=$database;host=$host", $username, $password); die "Connection failed " . DBI->errstr() unless $dbh2; $dbh2->do("KILL $threadid"); $dbh2->disconnect(); sleep 1; my ($val) = $dbh->selectrow_array("SELECT 1"); print "You do not have the bug. Also, autoreconnection: " . ($val ? "succeeded" : "failed") . "\n";
From: daniel.frett [...] ccci.org
On Tue Oct 07 11:38:43 2008, ELACOUR wrote: Show quoted text
> Hi, > > I would like to report information about this problem (see also > http://bugs.mysql.com/bug.php?id=36810). > > Using RT on Debian lenny, and fastcgi, we encouter sometimes this > problem (the fastcgi process segfault). > > It's in the DBD::mysql ping function, here are the steps I used to > reproduce it: > > - set low timeout in my.cnf (10s) > - start the app (RT) > * I show a first connect and ping > - wait for timeout using SHOW FULL PROCESSLIST > - connect to the app > * works fine, RT reconnects, ping works, adding debug in > mysql_db_reconnect function I see that "imp_dbh->auto_reconnect" is > false and so there is no automatic reconnect from DBD, but RT has code > to do it and does it. > - wait timeout another time > - reconnect to the app > * mysql_db_reconnect detect now that auto_reconnect is on (why???) try > to reconnect, return TRUE, then the next call to mysql_ping in the > DBD::mysql ping function segfault. > > Please don't hesitate to ask if you need more debugging to solve this :) > >
This is a duplicate of this bug report. http://rt.cpan.org/Public/Bug/Display.html?id=37027 -Daniel
I have also seen this problem: http://www.mail-archive.com/dbi-users@perl.org/msg31416.html Please let me know if I can help to test any code :) Cheers, Edmund
From: timo2009 [...] ballin.se
On Fr. 10. Okt. 2008, 05:39:48, EVDB wrote: I can confirm this problem on Solaris: With Apache 2.2 and mod_perl2 ( sql authentification module - similar to Apache::AuthDBI ) while connecting to a external mysql 4.1.22 DB. But I think the "trigger" is the short connect timout on that server.
Download perl_dbd_mysql_report.txt.gz
application/x-gzip 3.8k

Message body not shown because it is not plain text.