ID: 38632 Updated by: [EMAIL PROTECTED] Reported By: chris dot vigelius at gmx dot net -Status: Open +Status: Bogus Bug Type: Reproducible crash Operating System: Linux 2.6.16 (SUSE 10.1) PHP Version: 5.1.5 New Comment:
Fixed in 5_2 and HEAD. Previous Comments: ------------------------------------------------------------------------ [2006-08-28 16:41:34] chris dot vigelius at gmx dot net Description: ------------ when executing the code below, PHP will crash with a segmentation fault. Note: To reproduce the crash, the database "test" must exist and contain a table "user" with an entry with id=1 (or to put it differently: the query must at least return one result). Versions of software used: mysql 5.0.18 php 5.1.6 Reproduce code: --------------- <?php class test { protected static $dbh; protected function connect() { self::$dbh = new PDO('mysql:host=localhost;dbname=test', 'test', 'test'); } public function read($uid) { self::connect(); $stmt = self::$dbh->prepare("SELECT * FROM user WHERE id = :uid"); $result = $stmt->execute(array(':uid' => 1)); $rows = $result->fetchAll(PDO::FETCH_OBJ); var_dump($result, $rows); } } $t = new test(); $t->read(1); Expected result: ---------------- some error messages, but no segfault Actual result: -------------- segmentation fault: PHP Fatal error: Call to a member function fetchAll() on a non-object in /home/chris/workspace/testing/crash.php on line 19 Fatal error: Call to a member function fetchAll() on a non-object in /home/chris/workspace/testing/crash.php on line 19 Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1216100688 (LWP 20861)] 0xb7a9cc07 in mysql_more_results () from /usr/lib/mysql/libmysqlclient.so.15 (gdb) bt #0 0xb7a9cc07 in mysql_more_results () from /usr/lib/mysql/libmysqlclient.so.15 #1 0x0818cdf1 in pdo_row_new () #2 0x0818cf6d in pdo_dbstmt_free_storage () #3 0x082ddef2 in zend_objects_store_free_object_storage () #4 0x082b6cd9 in shutdown_executor () #5 0x082c2671 in zend_deactivate () #6 0x082809d4 in php_request_shutdown () #7 0x08344908 in main () ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=38632&edit=1