From: daan at parse dot nl
Operating system: Slackware 10.2
PHP version: 5.1.5
PHP Bug Type: Reproducible crash
Bug description: Segfault in pdo_mysql_stmt_dtor
Description:
------------
Segmentation fault when doing a PDO query.
Using php 5.1.6
Reproduce code:
---------------
<?
function test1($options)
{
$test_pdo = new PDO(
'mysql:dbname={your_dbname};host={your_host}',
'{your_username}',
'{your_password}'
);
/* valid insert into existing table */
$result = $test_pdo->query('INSERT INTO user SET name="asdas"');
// Nonsense call
$lalal->bababa();
}
test1($options);
echo 'I make it - yay!';
?>
Expected result:
----------------
Error on the $lala->bababa() function.
Actual result:
--------------
Segmentation fault.
Extra:
- When you don't assign the result of the $test_pdo->query() call to a
variable, no segmentation fault occurs.
- Call has to take place inside a function or method - calling it regulary
will not trigger the crash
Backtrace:
#0 0x405fc05a in mysql_more_results () from
/usr/local/apache-php5/libexec/libphp5.so
#1 0x40464700 in pdo_mysql_stmt_dtor (stmt=0x8328a1c)
at /usr/src/php-5.1.6/ext/pdo_mysql/mysql_statement.c:67
#2 0x40461687 in free_statement (stmt=0x8328a1c)
at /usr/src/php-5.1.6/ext/pdo/pdo_stmt.c:2200
#3 0x405ab129 in zend_objects_store_free_object_storage
(objects=0x407d877c)
at /usr/src/php-5.1.6/Zend/zend_objects_API.c:86
#4 0x4058aac9 in shutdown_executor () at
/usr/src/php-5.1.6/Zend/zend_execute_API.c:281
#5 0x405954ef in zend_deactivate () at /usr/src/php-5.1.6/Zend/zend.c:854
#6 0x4055f55e in php_request_shutdown (dummy=0x0) at
/usr/src/php-5.1.6/main/main.c:1292
#7 0x405f64fa in apache_php_module_main (r=0x80cadd4,
display_source_mode=0)
at /usr/src/php-5.1.6/sapi/apache/sapi_apache.c:59
#8 0x405f6f65 in send_php (r=0x80cadd4, display_source_mode=0,
filename=0x0)
at /usr/src/php-5.1.6/sapi/apache/mod_php5.c:661
#9 0x405f70e3 in send_parsed_php (r=0x80cadd4)
at /usr/src/php-5.1.6/sapi/apache/mod_php5.c:676
#10 0x08053ff7 in ap_invoke_handler ()
#11 0x08069039 in process_request_internal ()
#12 0x08069098 in ap_process_request ()
#13 0x080600ba in child_main ()
#14 0x08060262 in make_child ()
#15 0x080603c8 in startup_children ()
#16 0x08060a88 in standalone_main ()
#17 0x080612a6 in main ()
--
Edit bug report at http://bugs.php.net/?id=38651&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38651&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38651&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38651&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38651&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38651&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38651&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38651&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38651&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38651&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38651&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38651&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38651&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38651&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38651&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38651&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38651&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38651&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38651&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38651&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38651&r=mysqlcfg