From: [email protected]
Operating system:
PHP version: 5.3CVS-2009-02-16 (CVS)
PHP Bug Type: PDO related
Bug description: PDO_Firebird segfaults when passing lowercased column name to
bindColumn()
Description:
------------
The problem just happens when using lowercased column name in boundColumn
calls. Using uppercased occurs memleaks though. (probably related to
#47414)
Reproduce code:
---------------
<?php
$db = new PDO('firebird:dbname=...', 'sysdba', 'foo');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
@$db->exec('drop table test');
$db->exec('CREATE TABLE test(idx int NOT NULL PRIMARY KEY, txt
VARCHAR(20))');
$db->exec('INSERT INTO test VALUES(0, \'String0\')');
$stmt = $db->prepare('SELECT idx, txt FROM test ORDER by idx');
$idx = $txt = 0;
$stmt->bindColumn('idx', $idx);
$stmt->bindColumn('txt', $txt);
$stmt->execute();
$stmt->fetch(PDO::FETCH_BOUND);
Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb79ee8e0 (LWP 5961)]
0x081d3466 in firebird_stmt_get_col (stmt=0x8c3ac5c, colno=-1,
ptr=0xbf7fb76c, len=0xbf7fb768, caller_frees=0xbf7fb764,
tsrm_ls=0x8af8050)
at /home/felipe/dev/php5/ext/pdo_firebird/firebird_statement.c:273
273 if (*var->sqlind == -1) {
(gdb) bt
#0 0x081d3466 in firebird_stmt_get_col (stmt=0x8c3ac5c, colno=-1,
ptr=0xbf7fb76c, len=0xbf7fb768, caller_frees=0xbf7fb764,
tsrm_ls=0x8af8050)
at /home/felipe/dev/php5/ext/pdo_firebird/firebird_statement.c:273
#1 0x081d47d9 in firebird_stmt_param_hook (stmt=0x8c3ac5c,
param=0x8c3b3d4, event_type=PDO_PARAM_EVT_FETCH_POST, tsrm_ls=0x8af8050)
at /home/felipe/dev/php5/ext/pdo_firebird/firebird_statement.c:555
#2 0x081c766e in dispatch_param_event (stmt=0x8c3ac5c,
event_type=PDO_PARAM_EVT_FETCH_POST, tsrm_ls=0x8af8050) at
/home/felipe/dev/php5/ext/pdo/pdo_stmt.c:184
#3 0x081c88d2 in do_fetch_common (stmt=0x8c3ac5c, ori=PDO_FETCH_ORI_NEXT,
offset=0, do_bind=1, tsrm_ls=0x8af8050) at
/home/felipe/dev/php5/ext/pdo/pdo_stmt.c:705
#4 0x081ca077 in do_fetch (stmt=0x8c3ac5c, do_bind=1,
return_value=0x8c3b238, how=PDO_FETCH_BOUND, ori=PDO_FETCH_ORI_NEXT,
offset=0, return_all=0x0,
tsrm_ls=0x8af8050) at /home/felipe/dev/php5/ext/pdo/pdo_stmt.c:934
#5 0x081cba40 in zim_PDOStatement_fetch (ht=1, return_value=0x8c3b238,
return_value_ptr=0x0, this_ptr=0x8c38100, return_value_used=0,
tsrm_ls=0x8af8050)
at /home/felipe/dev/php5/ext/pdo/pdo_stmt.c:1391
#6 0x084331b8 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8c6745c, tsrm_ls=0x8af8050) at
/home/felipe/dev/php5/Zend/zend_vm_execute.h:313
#7 0x08434337 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0x8c6745c, tsrm_ls=0x8af8050) at
/home/felipe/dev/php5/Zend/zend_vm_execute.h:422
--
Edit bug report at http://bugs.php.net/?id=47415&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47415&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47415&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47415&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47415&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47415&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47415&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47415&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47415&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47415&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47415&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47415&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47415&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47415&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47415&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47415&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47415&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47415&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47415&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47415&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47415&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47415&r=mysqlcfg