From:             xcenti at gmail dot com
Operating system: Linux
PHP version:      5.1.2
PHP Bug Type:     PDO related
Bug description:  bindvalue doing segfault (pdo_pgsql)

Description:
------------
segfault under Linux in PHP 5.1.2 and 5.1.3RC4-dev (under Windows with PHP
5.1.2 no problem)

Reproduce code:
---------------
<?php
$dbh = new PDO('pgsql:dbname=mypgdb;host=localhost', 'xxx', 'xxx');

$stmt = $dbh->prepare('SELECT :name, :name');
$stmt->bindValue(':name', 'foo');
$stmt->execute();
?>


Expected result:
----------------
all, but not crash


Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1424372816 (LWP 10842)]
0xb7b189b0 in mallopt () from /lib/tls/libc.so.6
(gdb) bt
#0  0xb7b189b0 in mallopt () from /lib/tls/libc.so.6
#1  0xb7b17c43 in malloc () from /lib/tls/libc.so.6
#2  0xb74501c6 in initPQExpBuffer () from /usr/lib/libpq.so.4
#3  0xb744ec89 in pqGetErrorNotice3 () from /usr/lib/libpq.so.4
#4  0xb744e3f0 in pqParseInput3 () from /usr/lib/libpq.so.4
#5  0xb74472d9 in PQconsumeInput () from /usr/lib/libpq.so.4
#6  0xb7447461 in PQgetResult () from /usr/lib/libpq.so.4
#7  0xb74477bb in PQexecPrepared () from /usr/lib/libpq.so.4
#8  0xb7680e4f in pgsql_stmt_execute (stmt=0x840f768, tsrm_ls=0x82a9218)
at /root/php5.1-200604230030/ext/pdo_pgsql/pgsql_statement.c:136
#9  0xb7678c70 in zif_PDOStatement_execute (ht=1, return_value=0x840fac0,
return_value_ptr=0x0, this_ptr=0x1, return_value_used=1,
tsrm_ls=0x82a9218)
    at /root/php5.1-200604230030/ext/pdo/pdo_stmt.c:451
#10 0xb78437e8 in zend_do_fcall_common_helper_SPEC
(execute_data=0xab197ab0, tsrm_ls=0x82a9218) at zend_vm_execute.h:200
#11 0xb7842cec in execute (op_array=0x8342158, tsrm_ls=0x82a9218) at
zend_vm_execute.h:92
#12 0xb784345f in zend_do_fcall_common_helper_SPEC
(execute_data=0xab19a080, tsrm_ls=0x82a9218) at zend_vm_execute.h:234
#13 0xb7842cec in execute (op_array=0x833d948, tsrm_ls=0x82a9218) at
zend_vm_execute.h:92
#14 0xb784345f in zend_do_fcall_common_helper_SPEC
(execute_data=0xab19a4e0, tsrm_ls=0x82a9218) at zend_vm_execute.h:234
#15 0xb7842cec in execute (op_array=0x8329fa0, tsrm_ls=0x82a9218) at
zend_vm_execute.h:92
#16 0xb78239ec in zend_execute_scripts (type=8, tsrm_ls=0x82a9218,
retval=0x0, file_count=3) at /root/php5.1-200604230030/Zend/zend.c:1109
#17 0xb77d9329 in php_execute_script (primary_file=0xab19c870,
tsrm_ls=0x82a9218) at /root/php5.1-200604230030/main/main.c:1732
#18 0xb78a61ee in php_handler (r=0x82be060) at
/root/php5.1-200604230030/sapi/apache2handler/sapi_apache2.c:586
#19 0x0807a155 in ap_run_handler ()
#20 0x0807a760 in ap_invoke_handler ()
#21 0x08069d5a in ap_process_request ()
#22 0x0806521d in _start ()
#23 0x082be060 in ?? ()
#24 0x00000004 in ?? ()
#25 0x082be060 in ?? ()
#26 0x080854cc in ap_run_pre_connection ()
#27 0x08085385 in ap_run_process_connection ()
#28 0x080766d1 in ap_graceful_stop_signalled ()
#29 0x08076e9a in ap_graceful_stop_signalled ()
#30 0xb7c3cf36 in apr_threadattr_stacksize_set () from
/usr/lib/libapr-0.so.0
#31 0xb7bdfb63 in start_thread () from /lib/tls/libpthread.so.0
#32 0xb7b7e18a in clone () from /lib/tls/libc.so.6


-- 
Edit bug report at http://bugs.php.net/?id=37174&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=37174&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): 
http://bugs.php.net/fix.php?id=37174&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=37174&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37174&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=37174&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37174&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37174&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37174&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37174&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37174&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=37174&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=37174&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37174&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37174&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37174&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37174&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37174&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37174&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37174&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37174&r=mysqlcfg

Reply via email to