From:             [EMAIL PROTECTED]
Operating system: Solaris 8/Intel
PHP version:      4.1.2
PHP Bug Type:     LDAP related
Bug description:  Conflict between OpenLDAP and Oracle

PHP dumps core when compiled with both LDAP and OCI8. The reason is the
Oracle client libraries include an LDAP library, and PHP is calling the
Oracle ldap_modify_s instead of the OpenLDAP ldap_modify_s. We are using
OpenLDAP 1.2.11 and Oracle 8.1.6.

Short-term workaround: use LD_PRELOAD, e.g. add:


to your Apache start scripts.

Here is the gdb backtrace:

(gdb) r -X -f /usr/local/apache/conf/httpd-kefta.conf
Starting program: /usr/local/apache/bin/httpd -X -f
[New LWP 1]
[New LWP 2]
[New LWP 3]
warning: Lowest section in /usr/lib/ is .dynamic at 00000074
[New LWP 4]
warning: Lowest section in /usr/lib/ is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0xde589e0a in gsleenSBerPrintf () from
(gdb) bt
#0  0xde589e0a in gsleenSBerPrintf ()
   from /export/home/oracle/lib/
#1  0xde580234 in gslcmom_Modify ()
   from /export/home/oracle/lib/
#2  0xde57d8e7 in ldap_modify_s ()
   from /export/home/oracle/lib/
#3  0xdee2f440 in php_ldap_do_modify (ht=3, return_value=0x81f5d0c,
    this_ptr=0x0, return_value_used=0, oper=2) at ldap.c:1364
#4  0xdee2f5e1 in zif_ldap_modify (ht=3, return_value=0x81f5d0c,
    return_value_used=0) at ldap.c:1399
#5  0xdedd51b9 in execute (op_array=0x8195fc0) at ./zend_execute.c:1590
#6  0xdedd540c in execute (op_array=0x819296c) at ./zend_execute.c:1630
#7  0xdede66b0 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at zend.c:814
#8  0xdedf98c1 in php_execute_script (primary_file=0x8047808) at
#9  0xdedf3d4a in apache_php_module_main (r=0x818a750,
    at sapi_apache.c:90
#10 0xdedf4f00 in send_php (r=0x818a750, display_source_mode=0,
    filename=0x818c338 "/usr/local/apache/htdocs/mail/mailforward.php")
    at mod_php4.c:575
#11 0xdedf4f73 in send_parsed_php (r=0x818a750) at mod_php4.c:590
#12 0x8088945 in ap_invoke_handler (r=0x818a750) at http_config.c:517
#13 0x809e794 in process_request_internal (r=0x818a750) at
#14 0x809e7fe in ap_process_request (r=0x818a750) at http_request.c:1324
---Type <return> to continue, or q <return> to quit---q
(gdb) i sym

Here is the final link stage in compiling PHP. Please note -lldap is
supplied before -lclntsh, and thus OpenLDAP should resolve first, but
apparently this is not the case:

/bin/sh /home/majid/src/php-4.1.2/libtool --silent --mode=link gcc  -I.
majid/src/php-4.1.2/ -I/home/majid/src/php-4.1.2/main
2 -I/usr/local/ldap/include -I/export/home/oracle/rdbms/demo
le/network/public -Iexpat/xmltok -Iexpat/xmlparse -Iimap-4.7c/c-client
cal/apache/include -I/home/majid/src/php-4.1.2/Zend
e -I/usr/local/include -I/usr/local/ldap/include
l -I/export/home/oracle/rdbms/public -I/export/home/oracle/rdbms/demo
home/oracle/network/public -I/home/majid/src/php-4.1.2/ext/xml/expat 
/home/majid/src/php-4.1.2/TSRM -g -DEAPI -prefer-pic   -o
-rpath /hom
e/majid/src/php-4.1.2/libs -export-symbols
/php.sym -avoid-version -L/usr/ucblib
8/2.95.2 -L/usr/local/lib -L/usr/local/ldap/lib
-L/usr/local/mysql/lib/mysql -L/
export/home/oracle/lib  -R /usr/ucblib -R
2.8/2.95.2 -R /usr/local/lib -R /usr/local/ldap/lib -R
l -R /export/home/oracle/lib stub.lo  Zend/ 
sapi/apache/  m
ain/  regex/  ext/gd/ ext/imap/
ext/ldap/ ext/mhash/ ext/mysql/ ext/oci8/
cre/ ext/posix/ ext/session/
ext/standard/libs ext/xml/  TSRM/ -L/usr/local/ldap/lib
/lib -lgd -lmhash -llber -lldap -L/export/home/oracle/lib -lclient8
-lclntsh -L/
usr/local/mysql/lib/mysql -lmysqlclient -lpam -limap -ldl -lm -lthread
-laio -le
lf -ldl -lgen -lnsl -lsocket -lmysqlclient -lmhash -lldap -llber -lcrypt
-lpam -
lgd -lttf -lcrypt -lresolv -lresolv -lresolv -lm -ldl -lnsl -lsocket
-lsocket -l
gcc -lcrypt -lclntsh

Edit bug report at
Fixed in CVS:
Fixed in release:
Need backtrace:
Try newer version:
Not developer issue:
Expected behavior:
Not enough info:
Submitted twice:

Reply via email to