|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53820 segfault in when using shared oci8 extension
Submitted: 2011-01-23 08:52 UTC Modified: 2021-12-13 00:50 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: wxianda at gmail dot com Assigned: sixd (profile)
Status: Wont fix Package: OCI8 related
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-01-23 08:52 UTC] wxianda at gmail dot com
use the latest php 5.3.5, tested in:
gcc 4.4.5, ubuntu 10.10 x86, oracle express;
gcc ???, asia linux 2(same as RHEL5?) x86, oracle 10g R2;
gcc ???, centos 4.5 x86, oracle 10g R1.

./configure --disable-all --disable-cgi --without-pear --with-

extension_dir = "./modules"
extension =
oci8.privileged_connect = On

environment variable ORACLE_HOME and ORACLE_SID are both correct.

when using NULL as connection_string in oci_connect() to connect to oracle:
sapi/cli/php -c php.ini -r "oci_internal_debug(TRUE); 
var_dump(oci_connect('sys', 'sys', NULL, NULL, OCI_SYSDBA));"

it crashes:
OCI8 DEBUG: OCIHandleAlloc at (/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:1067)
OCI8 DEBUG: OCIConnectionPoolCreate at (/home/xianda/php-
OCI8 DEBUG: OCIConnectionPoolDestroy at (/home/xianda/php-
OCI8 DEBUG: OCIHandleFree at (/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:1070)
OCI8 DEBUG: OCINlsEnvironmentVariableGet at (/home/xianda/php-
OCI8 DEBUG L1: Got NO cached connection at (/home/xianda/php-
OCI8 DEBUG: Bypassing client-side session pool for session create at 
OCI8 DEBUG: OCIEnvNlsCreate at (/home/xianda/php-
OCI8 DEBUG: OCIHandleAlloc at (/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:2842)
OCI8 DEBUG: OCIServerAttach at (/home/xianda/php-
Segmentation fault

and the call stack shows that it crashes inside the

But if I provide a value for connection_string in oci_connect(), it works fine, 
and the call stack in the is different.

And I try to build php using oci8 as a "static" extension(--oci8=$ORACLE_HOME), 
it also works fine when setting connection_string to NULL(this proves that my 
ORACLE_HOME and ORACLE_SID are correct).

And I test this in the previous three platforms, it acts the same. And I also 
try to use the latest instant client 10 and 11, the same results come out. So I 
believe that it can be easily reproduced in most or all platforms.

So is it the bug of php or oracle's client library???


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-23 08:54 UTC] wxianda at gmail dot com
-Summary: segfault in when using shared oci8 extension +Summary: segfault in when using shared oci8 extension
 [2011-01-23 08:54 UTC] wxianda at gmail dot com
sorry i type something wrong in the summary so i have to make an update
 [2011-01-23 09:14 UTC] wxianda at gmail dot com
And I try to use LD_PRELOAD to preload the at program starting, and 
it works just fine:

$ LD_PRELOAD=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/ 
sapi/cli/php -c php.ini -r "var_dump(oci_connect('sys', 'sys', NULL, NULL, 
resource(4) of type (oci8 connection)

so it seems that the crash is caused by "symbol resolution"???
 [2011-01-23 10:47 UTC] wxianda at gmail dot com
i try to disable the RTLD_DEEPBIND in Zend/zend.h and then make a build, and it 
also works fine.
 [2011-01-24 19:30 UTC]
-Assigned To: +Assigned To: sixd
 [2011-11-08 00:54 UTC]
Thanks for the analysis.  I've logged an Oracle bug to track this: 13357270.

I could reproduce the crash in one older 32 bit environment but could not 
reproduce it with Oracle or on 64 bit Oracle Linux 5.7.
 [2011-11-08 00:54 UTC]
-Status: Assigned +Status: Suspended
 [2021-12-13 00:50 UTC]
-Status: Suspended +Status: Wont fix
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Sep 26 02:01:24 2023 UTC