Edit report at http://bugs.php.net/bug.php?id=53461&edit=1
ID: 53461 Updated by: s...@php.net Reported by: stephen dot lucius dot wolf at gmail dot com Summary: Segmentation fault when reading clob with pdo oci -Status: Open +Status: Duplicate Type: Bug Package: PDO related Operating System: RedHat 5.1.2 PHP Version: 5.3.3 Block user comment: N Private report: N New Comment: Duplicate of http://pecl.php.net/bugs/bug.php?id=11320 Also see http://bugs.php.net/bug.php?id=39199 for a patch for PDO_OCI and stream_get_contents() Previous Comments: ------------------------------------------------------------------------ [2010-12-03 11:01:19] stephen dot lucius dot wolf at gmail dot com 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 this bug report at http://bugs.php.net/bug.php?id=53461&edit=1