|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-04-26 17:46 UTC] justin at eblah dot com
[2013-04-26 17:46 UTC] justin at eblah dot com
-Summary: Segfault on fetch_object on used result Closed DB
Pointer
+Summary: Segfault when calling fetch_object on a use_result
and DB pointer has closed
[2013-04-27 07:37 UTC] johannes@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: mysql
[2013-04-27 15:42 UTC] laruence@php.net
[2013-04-27 15:42 UTC] laruence@php.net
-Status: Assigned
+Status: Closed
[2013-04-27 15:50 UTC] laruence@php.net
[2014-10-07 23:19 UTC] stas@php.net
[2014-10-07 23:19 UTC] stas@php.net
[2014-10-07 23:30 UTC] stas@php.net
[2014-10-07 23:30 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 12:00:02 2025 UTC |
Description: ------------ When using MYSQLI_USE_RESULT, then immediately closing the database, and then attempting to fetch_object() the result will result in a segmentation fault. PHP does not segfault if using fetch_array() or fetch_assoc(). Test script: --------------- <?php $db = new mysqli("127.0.0.1", "root", "root", "test"); $result = $db->query('SELECT 1', MYSQLI_USE_RESULT); $db->close(); $result->fetch_object(); Expected result: ---------------- An exception or php fatal error that states the database was closed. Actual result: -------------- [root@devz user]# /usr/bin/php segfault.php Warning: mysqli_result::fetch_object(): Error while reading a row in segfault.php on line 15 Segmentation fault