#38632 [NEW]: Segmentation fault with PDO/mysql
| From: | chris dot vigelius at gmx dot net | Date: | Mon, 28 Aug 2006 16:41:34 +0000 |
| Subject: | #38632 [NEW]: Segmentation fault with PDO/mysql | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-101446@lists.php.net to get a copy of this message | ||
From: chris dot vigelius at gmx dot net
Operating system: Linux 2.6.16 (SUSE 10.1)
PHP version: 5.1.5
PHP Bug Type: Reproducible crash
Bug description: Segmentation fault with PDO/mysql
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 bug report at http://bugs.php.net/?id=38632&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38632&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38632&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38632&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38632&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38632&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38632&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38632&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38632&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38632&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38632&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38632&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38632&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38632&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38632&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38632&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38632&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38632&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38632&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38632&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38632&r=mysqlcfg