ID:               38596
 User updated by:  [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         PDO related
 Operating System: Linux
 PHP Version:      5.1.5
 New Comment:

The problem also exists in PHP 5.2.0 RC1. The backtrace is identical
except for different line numbers:

#0  0x40402927 in mysql_more_results () from
/usr//lib/libmysqlclient.so.14
#1  0x0814bfb0 in free_statement (stmt=0x40793b54) at
/home/martin/src/php-5.2.0RC1/ext/pdo/pdo_stmt.c:2225
#2  0x082fd939 in zend_objects_store_free_object_storage
(objects=0x8477d78) at
/home/martin/src/php-5.2.0RC1/Zend/zend_objects_API.c:86
#3  0x082d4193 in shutdown_executor () at
/home/martin/src/php-5.2.0RC1/Zend/zend_execute_API.c:295
#4  0x082e1260 in zend_deactivate () at
/home/martin/src/php-5.2.0RC1/Zend/zend.c:839
#5  0x0829c678 in php_request_shutdown (dummy=0x0) at
/home/martin/src/php-5.2.0RC1/main/main.c:1300
#6  0x0835820e in main (argc=3, argv=0xbffffb64) at
/home/martin/src/php-5.2.0RC1/sapi/cli/php_cli.c:1250


Previous Comments:
------------------------------------------------------------------------

[2006-08-25 18:46:14] [EMAIL PROTECTED]

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



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38596&edit=1

Reply via email to