php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57998 oci_pconnect sometimes works / sometimes causes Apache Segmentation fault
Submitted: 2008-01-08 19:42 UTC Modified: 2008-01-30 13:53 UTC
From: dtbaker at gmail dot com Assigned:
Status: Duplicate Package: oci8 (PECL)
PHP Version: 5.2.1 OS: Linux (RedHat under Xen)
Private report: No CVE-ID: None
 [2008-01-08 19:42 UTC] dtbaker at gmail dot com
Description:
------------
Hello,

I am using OCI8 version 1.2.4 and Oracle Instant Client 10.2.0.3 to connect to an Oracle 10g Express database. 

My code works correctly when using oci_connect() or oci_new_connect() however when I try to use oci_pconnect() i get these in the apache error log:

[notice] child pid 17517 exit signal Segmentation fault (11)

I have been trying to solve this problem on an off for a month, different versions of instant client/php/etc..  every time just reverting back to using oci_connect().

A request to the oci_pconnect() php script works correctly the first time it is called after an apache restart. Subsequent requests do not always work, causing seg faults. The behavior seems to be random. 

Sometimes I get another error along with the seg fault:

oci_fetch_array() [function.oci-fetch-array]: ORA-24338: statement handle not executed in /var/www/html/oracle_script.php

I have tried to do a gdb backtrace however I can't seem to make it catch the seg faulted child process, should I be running apache in a different mode in order to do the gdb backtrace?

# httpd -V
Server version: Apache/2.2.6 (Unix)
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes

Regards,
Dave

Reproduce code:
---------------
$conn=oci_pconnect(_DB_USER,_DB_PASS,_DB_HOST,"AL32UTF8");

$sql = 'BEGIN "XXXXXSelect"(:Cursor,:ErrorNumber,:ErrorText); END;';
$stmt = oci_parse($conn, $sql);
$p_cursor = oci_new_cursor($conn);
oci_bind_by_name($stmt, ":Cursor", $p_cursor, -1, OCI_B_CURSOR);
oci_bind_by_name($stmt, ":ErrorNumber", $ErrorNumber, 18, SQLT_LNG);
oci_bind_by_name($stmt, ":ErrorText", $ErrorText, 4000, SQLT_CHR);
oci_execute($stmt);
oci_execute($p_cursor);
$DataArray=array();
while($row = oci_fetch_array($p_cursor, OCI_ASSOC)) {
  $DataArray[$row['XXXXID']][$row['XXXXID']] = $row;
}
oci_free_statement($stmt);
oci_free_statement($p_cursor);


Actual result:
--------------
in Apache error.log:

oci_fetch_array() [function.oci-fetch-array]: ORA-24338: statement handle not executed in /var/www/html/oracle_script.php

[notice] child pid 17517 exit signal Segmentation fault (11)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-08 20:31 UTC] dtbaker at gmail dot com
Here is the error I get under Apache 1.3:

[Wed Jan  9 11:20:32 2008] [notice] child pid 23223 exit signal Segmentation fault (11)

Here is the OCI8 portion of my php.ini file:

[oracle]
oci8.max_persistent=1
oci8.ping_interval=20
oci8.persistent_timeout=1300

Working on an apache/oracle client 11.1 debug output now
 [2008-01-08 22:34 UTC] dtbaker at gmail dot com
I installed the OCI8 1.3.0 Beta and oci_pconnect() works fine
 [2008-01-30 13:53 UTC] christopher dot jones at oracle dot com
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PECL.

+------------------------------------------------------------
| This turns out to be a duplicate of
| http://bugs.php.net/bug.php?id=42841 
| See that bug for the workaround and code fix.
+------------------------------------------------------------
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 05:01:29 2024 UTC