From:
Operating system: RedHat 5.1.2
PHP version: 5.3.3
Package: PDO related
Bug Type: Bug
Bug description:Segmentation fault when reading clob with pdo oci
Description:
------------
when fetching a clob value with pdo oci a segmentation fault is generated
when the result contains more than one entry. works fine with only one
result.
db:
column name data type
ID NUMBER
LARGE CLOB
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
Zend Server Community Edition Version 5.0.3
Apache/2.2.15 (Unix) PHP/5.3.3
oci8
Version 1.4.1
Revision $Revision: 293235 $
Test script:
---------------
// LARGE is a CLOB, the database contains 2 entries with id=1
$sql = 'SELECT ID, LARGE FROM TEST WHERE ID LIKE :id';
$bind = array(':id'=>'%1');
$rows = null;
try
{
$pdo = new
PDO('oci:dbname=xe;host=localhost:1521','username','pw');
$statement = $pdo->prepare($sql);
foreach($bind as $key=>$value)
{
$statement->bindValue($key,$value);
}
$result = $statement->execute();
if( $result )
$rows = $statement->fetchAll(PDO::FETCH_ASSOC);
}
catch (PDOException $e)
{
die($e->getMessage());
}
count($rows) > 0 ? $problem = stream_get_contents($rows[0]['LARGE']) :
$problem = 'empty';
echo $problem;
Expected result:
----------------
the first 'LARGE' value
Actual result:
--------------
[Thread debugging using libthread_db enabled]
[New Thread 0x110ac0 (LWP 10305)]
Detaching after fork from child process 10308.
Detaching after fork from child process 10309.
Program received signal SIGSEGV, Segmentation fault.
0x04926761 in kghufree () from /usr/local/zend/lib/libclntsh.so.11.1
(gdb) bt
#0 0x04926761 in kghufree () from /usr/local/zend/lib/libclntsh.so.11.1
#1 0x04913f27 in kohfrem () from /usr/local/zend/lib/libclntsh.so.11.1
#2 0x04913668 in kohfrr () from /usr/local/zend/lib/libclntsh.so.11.1
#3 0x0491360e in kohfrw () from /usr/local/zend/lib/libclntsh.so.11.1
#4 0x048eb068 in kollfrfn () from /usr/local/zend/lib/libclntsh.so.11.1
#5 0x03144fd7 in kpufdesc2 () from /usr/local/zend/lib/libclntsh.so.11.1
#6 0x03147dcb in kpufdesc () from /usr/local/zend/lib/libclntsh.so.11.1
#7 0x0311ce40 in OCIDescriptorFree () from
/usr/local/zend/lib/libclntsh.so.11.1
#8 0x0021f2ca in ?? () from /usr/local/zend/lib/php_extensions/pdo_oci.so
#9 0x0956e0cc in ?? ()
#10 0x00000032 in ?? ()
#11 0x0956e0cc in ?? ()
#12 0x013a956c in ?? () from /usr/local/zend/apache2/modules/libphp5.so
#13 0x09450264 in ?? ()
#14 0x00000000 in ?? ()
--
Edit bug report at http://bugs.php.net/bug.php?id=53461&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53461&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53461&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=53461&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53461&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=53461&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53461&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=53461&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=53461&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=53461&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=53461&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=53461&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=53461&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=53461&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=53461&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53461&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53461&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=53461&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=53461&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=53461&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=53461&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=53461&r=mysqlcfg