Bug #70073 [Opn->Ver]: mysqlnd crashes on

From: Date: Wed, 15 Jul 2015 16:02:02 +0000
Subject: Bug #70073 [Opn->Ver]: mysqlnd crashes on
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-194459@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70073&edit=1 ID: 70073 Updated by: ab@php.net Reported by: johntiror at gmail dot com -Summary: Apache crash +Summary: mysqlnd crashes on -Status: Open +Status: Verified Type: Bug Package: MySQL related -Operating System: Win 7 +Operating System: Winows/Linux PHP Version: 5.6Git-2015-07-14 (snap) Block user comment: N Private report: N New Comment: I reproduce this with the same backtrace on Linux/Windows in 5.6 and 7.0.0beta1 mysqlnd_fetch_stmt_row_cursor (result=0x7ffff685d780, param=0x7ffff6814210, flags=<optimized out>, fetched_anything=0x7fffffffac5f "") at /home/anatol/tmp/php-7.0.0beta1/ext/mysqlnd/mysqlnd_ps.c:1045 1045 SET_CLIENT_ERROR(*stmt->conn->error_info, CR_COMMANDS_OUT_OF_SYNC, UNKNOWN_SQLSTATE, (gdb) bt #0 mysqlnd_fetch_stmt_row_cursor (result=0x7ffff685d780, param=0x7ffff6814210, flags=<optimized out>, fetched_anything=0x7fffffffac5f "") at /home/anatol/tmp/php-7.0.0beta1/ext/mysqlnd/mysqlnd_ps.c:1045 #1 0x0000000000693a15 in php_mysqlnd_res_fetch_into_pub (result=0x7ffff685d780, flags=1, return_value=0x7ffff6814210, extension=MYSQLND_MYSQLI) at /home/anatol/tmp/php-7.0.0beta1/ext/mysqlnd/mysqlnd_result.c:1728 #2 0x000000000057c513 in php_mysqli_fetch_into_hash_aux (fetchtype=<optimized out>, result=<optimized out>, return_value=0x7ffff6814210) at /home/anatol/tmp/php-7.0.0beta1/ext/mysqli/mysqli.c:1216 #3 php_mysqli_fetch_into_hash (execute_data=<optimized out>, return_value=0x7ffff6814210, override_flags=<optimized out>, into_object=0) at /home/anatol/tmp/php-7.0.0beta1/ext/mysqli/mysqli.c:1267 What seems to go wrong is a "CALL test()" which mysqlnd internally thinks should deliver some data. Tested with MySQL 5.6.14. So the actual error must somewhere earlier in stmt::execute(). I'm not sure it should actually deliver some data at all, as that's a stored procedure. And this bug is kinda too MySQL specific me to decide about the correct behavior. Thanks. Previous Comments: ------------------------------------------------------------------------ [2015-07-14 16:32:00] johntiror at gmail dot com Description: ------------ Apache is crashing systematically with error: AH00428: Parent: child process 9628 exited with status 255 -- Restarting. APACHE error log: [Tue Jul 14 15:02:13.038276 2015] [mpm_winnt:notice] [pid 7044:tid 404] AH00428: Parent: child process 9448 exited with status 255 -- Restarting. [Tue Jul 14 15:02:13.324305 2015] [mpm_winnt:notice] [pid 7044:tid 404] AH00455: Apache/2.4.9 (Win32) PHP/5.5.12 configured -- resuming normal operations [Tue Jul 14 15:02:13.329306 2015] [mpm_winnt:notice] [pid 7044:tid 404] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13 [Tue Jul 14 15:02:13.329306 2015] [core:notice] [pid 7044:tid 404] AH00094: Command line: 'C:\\Program Files\\wamp\\bin\\apache\\apache2.4.9\\bin\\httpd.exe -d C:/Program Files/wamp/bin/apache/apache2.4.9' [Tue Jul 14 15:02:13.352308 2015] [mpm_winnt:notice] [pid 7044:tid 404] AH00418: Parent: Created child process 3140 [Tue Jul 14 15:02:14.528388 2015] [mpm_winnt:notice] [pid 3140:tid 332] AH00354: Child: Starting 64 worker threads. I checked windows event and I found httpd.exe is crashing caused by php5ts.dll Test script: --------------- HOW TO REPRODUCE: PHP code: $mysqli=new mysqli(DB_HOST, DB_USERNAME, DB_PASSWORD, DB_NAME); if (!($stmt = $mysqli->prepare("CALL test()"))) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } if (!$stmt->execute()) { echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error; } do { if ($res = $stmt->get_result()) { //Apache crash on this call printf("---\n"); var_dump($res->fetch_assoc()); mysqli_free_result($res); } else { if ($stmt->errno) { echo "Store failed: (" . $stmt->errno . ") " . $stmt->error; } } } while ($stmt->more_results() && $stmt->next_result()); Store procedure code: CREATE DEFINER=root@localhost PROCEDURE test() BEGIN declare test_var varchar(100) default "ciao"; declare bNoMoreRows bool default false; declare test_cursor cursor for select id from tmp_folder; declare continue handler for not found set bNoMoreRows := true; create temporary table tmp_folder select "test" as id; open test_cursor; fetch test_cursor into test_var; close test_cursor; select test_var; drop temporary table if exists tmp_folder; END Expected result: ---------------- I expect to read "test" in the browser Actual result: -------------- Apache is crashing ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70073&edit=1

« previous php.bugs (#194459) next »