From:             [EMAIL PROTECTED]
Operating system: Linux
PHP version:      5.3CVS-2008-10-11 (CVS)
PHP Bug Type:     PDO related
Bug description:  pdo_pgsql -  Segfault when using PDO::ATTR_STRINGIFY_FETCHES 
and blob

Description:
------------
See below.

Reproduce code:
---------------
<?php

$db = new PDO('pgsql:host=localhost dbname=teste', 'foo', 'bar',
array(PDO::ATTR_STRINGIFY_FETCHES => TRUE));

$res = $db->prepare("SELECT blob1 from test_one_blob");
$res->execute();
var_dump($res->fetch(PDO::FETCH_NUM));

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb77e26d0 (LWP 18255)]
0x0839a800 in _php_stream_stat (stream=0x88b4500, ssb=0xbfac2124,
tsrm_ls=0x8767070) at /home/felipe/dev/php5/main/streams/streams.c:693
693             if (stream->wrapper && stream->wrapper->wops->stream_stat != 
NULL) {
(gdb) bt
#0  0x0839a800 in _php_stream_stat (stream=0x88b4500, ssb=0xbfac2124,
tsrm_ls=0x8767070) at /home/felipe/dev/php5/main/streams/streams.c:693
#1  0x0839b9f0 in _php_stream_copy_to_mem (src=0x88b4500, buf=0xbfac21f0,
maxlen=0, persistent=0, __php_stream_call_depth=0, 
    __zend_filename=0x86bbd58 "/home/felipe/dev/php5/ext/pdo/pdo_stmt.c",
__zend_lineno=608, __zend_orig_filename=0x0, __zend_orig_lineno=0,
tsrm_ls=0x8767070)
    at /home/felipe/dev/php5/main/streams/streams.c:1254
#2  0x08130c5d in fetch_value (stmt=0x88b3bcc, dest=0x88b394c, colno=0,
type_override=0x0, tsrm_ls=0x8767070) at
/home/felipe/dev/php5/ext/pdo/pdo_stmt.c:608
#3  0x08132732 in do_fetch (stmt=0x88b3bcc, do_bind=1,
return_value=0x88b39e4, how=PDO_FETCH_NUM, ori=PDO_FETCH_ORI_NEXT,
offset=0, return_all=0x0, 
    tsrm_ls=0x8767070) at /home/felipe/dev/php5/ext/pdo/pdo_stmt.c:1123
#4  0x081338c6 in zim_PDOStatement_fetch (ht=1, return_value=0x88b39e4,
return_value_ptr=0x0, this_ptr=0x88b2318, return_value_used=1,
tsrm_ls=0x8767070)
    at /home/felipe/dev/php5/ext/pdo/pdo_stmt.c:1401
#5  0x0843efbd in zend_do_fcall_common_helper_SPEC
(execute_data=0x88e1674, tsrm_ls=0x8767070) at
/home/felipe/dev/php5/Zend/zend_vm_execute.h:315
#6  0x0844017b in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER
(execute_data=0x88e1674, tsrm_ls=0x8767070) at
/home/felipe/dev/php5/Zend/zend_vm_execute.h:428
#7  0x0843dd6c in execute (op_array=0x88b2ad0, tsrm_ls=0x8767070) at
/home/felipe/dev/php5/Zend/zend_vm_execute.h:104
#8  0x0840e59b in zend_execute_scripts (type=8, tsrm_ls=0x8767070,
retval=0x0, file_count=3) at /home/felipe/dev/php5/Zend/zend.c:1197
#9  0x0837ecbe in php_execute_script (primary_file=0xbfac48b8,
tsrm_ls=0x8767070) at /home/felipe/dev/php5/main/main.c:2080
#10 0x084add03 in main (argc=2, argv=0xbfac4a14) at
/home/felipe/dev/php5/sapi/cli/php_cli.c:1130


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

Reply via email to