Edit report at http://bugs.php.net/bug.php?id=53820&edit=1

 ID:                 53820
 Comment by:         wxianda at gmail dot com
 Reported by:        wxianda at gmail dot com
 Summary:            segfault in libclntsh.so when using shared oci8
                     extension
 Status:             Open
 Type:               Bug
 Package:            OCI8 related
 Operating System:   Linux
 PHP Version:        5.3.5
 Block user comment: N
 Private report:     N

 New Comment:

i try to disable the RTLD_DEEPBIND in Zend/zend.h and then make a build,
and it 

also works fine.


Previous Comments:
------------------------------------------------------------------------
[2011-01-23 09:14:05] wxianda at gmail dot com

And I try to use LD_PRELOAD to preload the libclntsh.so at program
starting, and 

it works just fine:



$
LD_PRELOAD=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/lib/libclntsh.so


sapi/cli/php -c php.ini -r "var_dump(oci_connect('sys', 'sys', NULL,
NULL, 

OCI_SYSDBA));"

resource(4) of type (oci8 connection)



so it seems that the crash is caused by "symbol resolution"???

------------------------------------------------------------------------
[2011-01-23 08:54:23] wxianda at gmail dot com

sorry i type something wrong in the summary so i have to make an update

------------------------------------------------------------------------
[2011-01-23 08:52:12] wxianda at gmail dot com

Description:
------------
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-

oci8=shared,$ORACLE_HOME

make



php.ini:

extension_dir = "./modules"

extension = oci8.so

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-

5.3.5.orig/ext/oci8/oci8.c:1068)

OCI8 DEBUG: OCIConnectionPoolDestroy at (/home/xianda/php-

5.3.5.orig/ext/oci8/oci8.c:1069)

OCI8 DEBUG: OCIHandleFree at
(/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:1070)

OCI8 DEBUG: OCINlsEnvironmentVariableGet at (/home/xianda/php-

5.3.5.orig/ext/oci8/oci8.c:1826)

OCI8 DEBUG L1: Got NO cached connection at (/home/xianda/php-

5.3.5.orig/ext/oci8/oci8.c:1871)

OCI8 DEBUG: Bypassing client-side session pool for session create at 

(/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:2833)

OCI8 DEBUG: OCIEnvNlsCreate at (/home/xianda/php-

5.3.5.orig/ext/oci8/oci8.c:2810)

OCI8 DEBUG: OCIHandleAlloc at
(/home/xianda/php-5.3.5.orig/ext/oci8/oci8.c:2842)

OCI8 DEBUG: OCIServerAttach at (/home/xianda/php-

5.3.5.orig/ext/oci8/oci8.c:2850)

Segmentation fault



and the call stack shows that it crashes inside the libclntsh.so.



But if I provide a value for connection_string in oci_connect(), it
works fine, 

and the call stack in the libclntsh.so 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???



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53820&edit=1

Reply via email to