Bug #71708 [NEW]: Oracle queries using oci_fetch_all causes Core Dumps
| From: | jodybrabec at gmail dot com | Date: | Thu, 03 Mar 2016 20:21:11 +0000 |
| Subject: | Bug #71708 [NEW]: Oracle queries using oci_fetch_all causes Core Dumps | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-199586@lists.php.net to get a copy of this message | ||
From: jodybrabec at gmail dot com
Operating system: RHEL 6.7
PHP version: 7.0.4
Package: OCI8 related
Bug Type: Bug
Bug description:Oracle queries using oci_fetch_all causes Core Dumps
Description:
------------
Oracle queries using oci_fetch_all causes Core Dumps sometimes if more
than one record result set.
My setup: oracle-instantclient12.1-basic, OCI8 2.1.0, PHP 70,
php70-php-cli (7.0.4-1.el6.remi - 2016-03-02), Red Hat EL 6.7, HTTPD 24
Observations on oci_fetch_all queries:
1. If the query return set contains only one record, no problems.
2. For more than one records return: Sometimes causes core dump
(browser Error 500 Internal server error).
a. If total return bytes is large, core dump probability increases
(possible cap on rows * bytes per record per clumn cell)
b. Or sometimes error on only 2+ records - yet removing various
columns reduces error probability.
c. Queries with "joins" increase error probability.
Test script:
---------------
// Cor dumps on many random queries - see Observations above
$statement= oci_parse($connID, $query);
oci_execute($statement)
// ================= BAD, CORE DUMP:
$numRows = oci_fetch_all($statement, $results);
Expected result:
----------------
yum php70-php-cli (remi) was updated last night, but still no work.
POSSIBLE WORKAROUND:
// *********** (THIS DOES NOT WORK RIGHT NOW!!!!) **********
$allCols = oci_num_fields($st);
$colNames = array();
for ($i_c = 1; $i_c <= $allCols; $i_c++) {
$aColName = oci_field_name($statement, $i_c);
$colNames[] = $aColName;
}
$numRows = 0;
while (($row = oci_fetch_array($statement, OCI_BOTH)) != false) {
$numRows++;
foreach ($colNames as $i_c=>$aColName)
$results[$aColName][] = $row[$aColName];
}
Actual result:
--------------
//~~~~~~~~~~~~~~~~~~~ CORE DUMP
#> tail /var/log/messages
Mar 2 22:17:17 node6 abrtd: Directory 'ccpp-2016-03-02-22:17:17-32306'
creation detected
Mar 2 22:17:17 node6 abrt[32307]: Saved core dump of pid 32306
(/opt/remi/php70/root/usr/bin/php-cgi) to
/var/spool/abrt/ccpp-2016-03-02-22:17:17-32306 (11370496 bytes)
Mar 2 22:17:17 node6 abrtd: Package 'php70-php-cli' isn't signed with
proper key
Mar 2 22:17:17 node6 abrtd: 'post-create' on
'/var/spool/abrt/ccpp-2016-03-02-22:17:17-32306' exited with 1
Mar 2 22:17:17 node6 abrtd: Deleting problem directory
'/var/spool/abrt/ccpp-2016-03-02-22:17:17-32306'
--
Edit bug report at https://bugs.php.net/bug.php?id=71708&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71708&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71708&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71708&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71708&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71708&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71708&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71708&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71708&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71708&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71708&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71708&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71708&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71708&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71708&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71708&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71708&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71708&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71708&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71708&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71708&r=mysqlcfg