From: valiak at gmail dot com
Operating system: linux
PHP version: 5.1.2
PHP Bug Type: PDO related
Bug description: needless bindValue make php core dump
Description:
------------
simple script coredumps
the configure parameters are
./configure --disable-cgi --prefix=/usr/local/php5.1-debug
--with-pdo-pgsql --with-gd --with-gd-native-ttf --with-jpeg-dir
--with-png-dir --with-xpm-dir --with-zlib --with-pgsql --with-freetype-dir
--enable-debug
the coredump is
#0 _zend_is_inconsistent (ht=0x0, file=0x83a6da8
"/home/NETAGESOLUTIONS/ce/inst/php-5.1.2/Zend/zend_hash.c", line=847)
at /home/NETAGESOLUTIONS/ce/inst/php-5.1.2/Zend/zend_hash.c:53
#1 0x082b36a2 in zend_hash_find (ht=0x0, arKey=0x852f924 ":test",
nKeyLength=6, pData=0x0)
at /home/NETAGESOLUTIONS/ce/inst/php-5.1.2/Zend/zend_hash.c:847
#2 0x0811fffe in pgsql_stmt_param_hook (stmt=0x8530ad4, param=0xbf855654,
event_type=PDO_PARAM_EVT_ALLOC)
at
/home/NETAGESOLUTIONS/ce/inst/php-5.1.2/ext/pdo_pgsql/pgsql_statement.c:232
#3 0x081178f4 in really_register_bound_param (param=0xbf855654,
stmt=0x8530ad4, is_param=1)
at /home/NETAGESOLUTIONS/ce/inst/php-5.1.2/ext/pdo/pdo_stmt.c:330
#4 0x081184c1 in zif_PDOStatement_bindValue (ht=3,
return_value=0x8530e04, return_value_ptr=0x0, this_ptr=0x0,
return_value_used=0)
at /home/NETAGESOLUTIONS/ce/inst/php-5.1.2/ext/pdo/pdo_stmt.c:1503
#5 0x082c4dbd in zend_do_fcall_common_helper_SPEC
(execute_data=0xbf855d60) at zend_vm_execute.h:192
#6 0x082c4372 in execute (op_array=0x85274ac) at zend_vm_execute.h:92
#7 0x082a7ce3 in zend_execute_scripts (type=8, retval=0x83a6da8,
file_count=3)
at /home/NETAGESOLUTIONS/ce/inst/php-5.1.2/Zend/zend.c:1101
#8 0x082666f2 in php_execute_script (primary_file=0xbf8581b4) at
/home/NETAGESOLUTIONS/ce/inst/php-5.1.2/main/main.c:1720
#9 0x08345f90 in main (argc=2, argv=0xbf8582f4) at
/home/NETAGESOLUTIONS/ce/inst/php-5.1.2/sapi/cli/php_cli.c:1077
Reproduce code:
---------------
<?
$dbh = new PDO('pgsql:dbname=test;host=localhost', 'xxxx', 'xxxx');
$stmt = $dbh->prepare('SELECT * FROM child');
$stmt->bindValue(':test', 1, PDO::PARAM_INT);
$stmt->execute();
?>
Expected result:
----------------
just nothing special - not to coredump, or some kind of error to indicate
that could not bind ":test"
Actual result:
--------------
[EMAIL PROTECTED]:~/tmp$ /usr/local/php5.1-debug/bin/php test.php
Segmentation fault (core dumped)
--
Edit bug report at http://bugs.php.net/?id=36727&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=36727&r=trysnapshot44
Try a CVS snapshot (PHP 5.1):
http://bugs.php.net/fix.php?id=36727&r=trysnapshot51
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=36727&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=36727&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=36727&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=36727&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=36727&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=36727&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=36727&r=support
Expected behavior: http://bugs.php.net/fix.php?id=36727&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=36727&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=36727&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=36727&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36727&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=36727&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=36727&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=36727&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=36727&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=36727&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=36727&r=mysqlcfg