From: jan dot schmidt at vitronic dot de
Operating system: Win XP SP3
PHP version: 5.2.9
PHP Bug Type: PDO related
Bug description: crash while prepare statement
Description:
------------
I'm running an Apache 2.2.9 Webserver and a MySQL 5.1.31 Database and want
to insert a lot of rows over PDO MySQL Extension. But if the testscript is
very often requested, php crashes while preparing a statement.
I find out that the easiest way to reproduce the crash is to open the
testscript in firefox and keep the F5 Key pressed.
For the backtrace i used the php 5.2 snap from 2009-04-01.
Only the pdo and pdo_mysql extensions are loaded.
Reproduce code:
---------------
<?php
$dbhandle = new PDO('mysql:host=localhost', 'root',
'mypass',array(PDO::ATTR_PERSISTENT => true));
$dbhandle->exec('SET CHARACTER SET utf8');
$dbhandle->exec('CREATE DATABASE testdb');
$dbhandle->exec('CREATE TABLE testdb.testtable(id bigint(20) NOT NULL
AUTO_INCREMENT, testcol text collate utf8_unicode_ci NOT NULL, PRIMARY
KEY(id))');
for($i = 0;$i < 100;$i++)
{
$stmt = $dbhandle->prepare('INSERT INTO testdb.testtable (testcol)
VALUES (:testcol)');
$stmt->bindValue(':testcol','testentrie nr '.$i,PDO::PARAM_STR);
$stmt->execute();
}
?>
Expected result:
----------------
Script insert 100 rows to Table testtable.
Actual result:
--------------
Script Crashes
Backtrace:
_zend_mm_free_int(_zend_mm_heap * 0x0110faf8, void * 0x002e0000) line 1974
+ 132 bytes
_efree(void * 0x00fb5200) line 2306 + 11 bytes
_zval_ptr_dtor(_zval_struct * * 0x0558fa8c) line 415 + 37 bytes
zend_std_write_property(_zval_struct * 0x015e2b9a, _zval_struct *
0x05d6d530, _zval_struct * 0x00fb5200, void * * * 0x05d6d230) line 417 + 12
bytes
pdo_stmt_construct(_pdo_stmt_t * 0x015e2a0d, _zval_struct * 0x05d6d348,
_zend_class_entry * 0x05d6d530, _zval_struct * 0x00fb5090, void * * *
0x00000000) line 447
zim_PDO_prepare(int 7916969, _zval_struct * 0x00fb5090, _zval_struct * *
0x05d6d530, _zval_struct * 0x00000000, int 93948008, void * * * 0x00000001)
line 581 + 22 bytes
zend_do_fcall_common_helper_SPEC(_zend_execute_data * 0x0078c5c5, void * *
* 0x0558fbb0) line 200 + 61 bytes
ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data * 0x0558fbb0, void *
* * 0x0110ece0) line 322 + 17 bytes
execute(_zend_op_array * 0x0082e6fd, void * * * 0x00000008) line 92 + 12
bytes
php_execute_script(_zend_file_handle * 0x05d6d4dc, void * * * 0x00000000)
line 2023 + 18 bytes
05d6d19c()
05d6d190()
PHP_PDO! pdo_row_object_handlers + 200 bytes
--
Edit bug report at http://bugs.php.net/?id=47874&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47874&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47874&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47874&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47874&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47874&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47874&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47874&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47874&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47874&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47874&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47874&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47874&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47874&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47874&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47874&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47874&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47874&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47874&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47874&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47874&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47874&r=mysqlcfg