|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-08-25 19:07 UTC] mj@php.net
[2006-08-25 20:45 UTC] pajoye@php.net
[2006-08-26 09:01 UTC] mj@php.net
[2006-08-26 10:49 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 18:00:02 2025 UTC |
Description: ------------ [Note: This bug is against PHP 5.1.6, but the bug interface only offers 5.1.5.] The code below makes PHP segfault at the time that exit() is called. This happens with both CLI and Apache 2 (prefork). I'm using MySQL 4.1.11. If the return value of prepare() is not assigned to a variable, the script does not crash. Also it does not crash when omitting the exit() call. Reproduce code: --------------- <?php class SomeClass { public function doSomething($id) { $dsn = "mysql:host=localhost;dbname=weblog"; $db = new PDO($dsn, "weblog", "weblog"); $stm = $db->prepare("UPDATE entry SET id = ?"); exit(); } } $obj = new SomeClass; $obj->doSomething(1); Expected result: ---------------- No crash. Actual result: -------------- #0 0x4011c927 in mysql_more_results () from /usr//lib/libmysqlclient.so.14 #1 0x08134329 in free_statement (stmt=0x84e351c) at /home/martin/src/php-5.1.6/ext/pdo/pdo_stmt.c:2200 #2 0x082a2349 in zend_objects_store_free_object_storage (objects=0x83f60dc) at /home/martin/src/php-5.1.6/Zend/zend_objects_API.c:86 #3 0x0828062f in shutdown_executor () at /home/martin/src/php-5.1.6/Zend/zend_execute_API.c:281 #4 0x0828b074 in zend_deactivate () at /home/martin/src/php-5.1.6/Zend/zend.c:854 #5 0x082513b6 in php_request_shutdown (dummy=0x0) at /home/martin/src/php-5.1.6/main/main.c:1292 #6 0x082f0cc0 in main (argc=3, argv=0xbffffb84) at /home/martin/src/php-5.1.6/sapi/cli/php_cli.c:1246