php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36727 needless bindValue make php core dump
Submitted: 2006-03-13 22:56 UTC Modified: 2006-03-17 23:19 UTC
From: valiak at gmail dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.1.2 OS: linux
Private report: No CVE-ID: None
 [2006-03-13 22:56 UTC] valiak at gmail dot com
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:
--------------
ce@ce:~/tmp$ /usr/local/php5.1-debug/bin/php test.php
Segmentation fault (core dumped)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-14 12:34 UTC] edink@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.1-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.1-win32-latest.zip


 [2006-03-14 13:39 UTC] valiak at gmail dot com
ce@ce:~/tmp$ /usr/local/php5.1-debug/bin/php test.php
Segmentation fault
ce@ce:~/tmp$ /usr/local/php5.1-debug/bin/php -v
PHP 5.1.3RC2-dev (cli) (built: Mar 14 2006 14:33:47) (DEBUG)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
 [2006-03-17 23:19 UTC] tony2001@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC