php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40589 mysqli can't handle a reconnect, crashes
Submitted: 2007-02-22 08:55 UTC Modified: 2007-03-06 11:28 UTC
From: pegasus at nerv dot eu dot org Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
 [2007-02-22 08:55 UTC] pegasus at nerv dot eu dot org
Description:
------------
If you set mysql timeouts (in my.cnf) to some short times, like:
set-variable = connect_timeout=3
set-variable = interactive_timeout=5
set-variable = wait_timeout=10

And then have a script, that opens mysql connection via mysqli, sleeps for 20 seconds and then tries to do something with that connection, php crashes.

Reproduce code:
---------------
Simple enough to reproduce from the comment above

Actual result:
--------------
Segfault:

#0  0xb7638542 in net_clear () from /usr/lib/./libmysqlclient.so.15
#1  0xb7613df3 in cli_stmt_execute () from /usr/lib/./libmysqlclient.so.15
#2  0xb76142b3 in mysql_stmt_execute () from /usr/lib/./libmysqlclient.so.15
#3  0x081e806c in zif_mysqli_stmt_execute ()
#4  0x0842a8ea in execute ()
#5  0x0842ada6 in execute ()
#6  0x0842a516 in execute ()
#7  0x0840c9da in zend_execute_scripts ()
#8  0x083ca2f4 in php_execute_script ()
#9  0x0846c701 in main ()

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-02-22 09:42 UTC] pegasus at nerv dot eu dot org
Forgot to mention that this only happens when using prepared statements.
 [2007-02-22 10:53 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2007-02-26 15:46 UTC] andrey@php.net
 Hi,
can you specify which version of libmysql do you use, phpinfo() page should say what is the version of the headers.
It seems like http://bugs.mysql.com/bug.php?id=12744 , but it could be another place in libmysql where similar crash occurs. Your help is very appreciated!

Regards,
Andrey
 [2007-03-01 09:43 UTC] pegasus at nerv dot eu dot org
It certanly seems like mysql bug #12744, but I've expirienced it both with mysql 5.0.27 and 5.0.33.
 [2007-03-06 11:28 UTC] tony2001@php.net
Not PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 29 19:01:30 2024 UTC