Bug #77597 [Ver->Asn]: mysqli_fetch_field hangs scripts in PHP 7.3.2
| From: | nikic@php.net | Date: | Thu, 21 Feb 2019 12:24:47 +0000 |
| Subject: | Bug #77597 [Ver->Asn]: mysqli_fetch_field hangs scripts in PHP 7.3.2 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219677@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77597&edit=1
ID: 77597
Updated by: nikic@php.net
Reported by: ryan dot brothers at gmail dot com
Summary: mysqli_fetch_field hangs scripts in PHP 7.3.2
-Status: Verified
+Status: Assigned
Type: Bug
Package: MySQLi related
Operating System: Linux
PHP Version: 7.3.2
-Assigned To:
+Assigned To: nikic
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2019-02-21 12:08:26] nikic@php.net
From the debug trace, there's an infinite loop of php_mysqlnd_rowp_read_text_protocol_c calls:
<mysqlnd_conn_data::store_result (total=5397 own=237 in_calls=5160)
>mysqlnd_res::fetch_field
| info : We have decode the whole result set to be able to satisfy this meta request
| >mysqlnd_result_buffered_c::initialize_result_set_rest
| | >php_mysqlnd_rowp_read_text_protocol_c
| | | >php_mysqlnd_rowp_read_text_protocol_aux
| | | <php_mysqlnd_rowp_read_text_protocol_aux (total=0 own=0 in_calls=0)
| | <php_mysqlnd_rowp_read_text_protocol_c (total=38 own=38 in_calls=0)
| | >php_mysqlnd_rowp_read_text_protocol_c
| | | >php_mysqlnd_rowp_read_text_protocol_aux
| | | <php_mysqlnd_rowp_read_text_protocol_aux (total=0 own=0 in_calls=0)
| | <php_mysqlnd_rowp_read_text_protocol_c (total=37 own=37 in_calls=0)
...
------------------------------------------------------------------------
[2019-02-11 02:32:36] ryan dot brothers at gmail dot com
Related To: Bug #68548
------------------------------------------------------------------------
[2019-02-11 02:30:20] ryan dot brothers at gmail dot com
Description:
------------
I am running into an issue with PHP 7.3.2 where calling mysqli_fetch_field hangs the script. The
same script in PHP 7.2.15 runs successfully.
It only occurs when calling store_result() with MYSQLI_STORE_RESULT_COPY_DATA
It could be related to bug #68548 that I submitted a few years ago, but something changed in PHP
7.3.2 that causes the call to hang completely now.
For the below test script, I'm using SQL:
DROP TABLE IF EXISTS a;
CREATE TABLE a (b int);
INSERT INTO a VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
Test script:
---------------
<?php
$mysqli = new mysqli('localhost', 'test', 'test', 'test');
$mysqli->real_query("SELECT * FROM a");
$result = $mysqli->store_result(MYSQLI_STORE_RESULT_COPY_DATA);
$field = $result->fetch_field();
Expected result:
----------------
Script runs and instantly exits.
Actual result:
--------------
In PHP 7.3.2 with MYSQLI_STORE_RESULT_COPY_DATA, the script hangs.
In PHP 7.2.15 with MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.
In PHP 7.3.2 without MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.
In PHP 7.2.15 without MYSQLI_STORE_RESULT_COPY_DATA, the script runs and instantly exits.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77597&edit=1