php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16005 Conflict between OpenLDAP and Oracle
Submitted: 2002-03-11 16:27 UTC Modified: 2002-06-21 18:41 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fmajid at kefta dot com Assigned:
Status: Closed Package: LDAP related
PHP Version: 4.2.1 OS: Solaris 8/Intel
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: fmajid at kefta dot com
New email:
PHP Version: OS:

 

 [2002-03-11 16:27 UTC] fmajid at kefta dot com
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:

LD_PRELOAD=/usr/local/ldap/lib/libldap.so
export LD_PRELOAD

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 /usr/local/apache/conf/httpd
-kefta.conf
[New LWP 1]
[New LWP 2]
[New LWP 3]
warning: Lowest section in /usr/lib/libintl.so.1 is .dynamic at 00000074
[New LWP 4]
warning: Lowest section in /usr/lib/libintl.so.1 is .dynamic at 00000074

Program received signal SIGSEGV, Segmentation fault.
0xde589e0a in gsleenSBerPrintf () from /export/home/oracle/lib/libclntsh.so.8.0
(gdb) bt
#0  0xde589e0a in gsleenSBerPrintf ()
   from /export/home/oracle/lib/libclntsh.so.8.0
#1  0xde580234 in gslcmom_Modify ()
   from /export/home/oracle/lib/libclntsh.so.8.0
#2  0xde57d8e7 in ldap_modify_s ()
   from /export/home/oracle/lib/libclntsh.so.8.0
#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, this_ptr=0x0,
    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 main.c:1307
#9  0xdedf3d4a in apache_php_module_main (r=0x818a750, display_source_mode=0)
    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 http_request.c:1308
#14 0x809e7fe in ap_process_request (r=0x818a750) at http_request.c:1324
---Type <return> to continue, or q <return> to quit---q
Quit
(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. -I/home/
majid/src/php-4.1.2/ -I/home/majid/src/php-4.1.2/main -I/home/majid/src/php-4.1.
2 -I/usr/local/ldap/include -I/export/home/oracle/rdbms/demo -I/export/home/orac
le/network/public -Iexpat/xmltok -Iexpat/xmlparse -Iimap-4.7c/c-client -I/usr/lo
cal/apache/include -I/home/majid/src/php-4.1.2/Zend -I/usr/local/include/freetyp
e -I/usr/local/include -I/usr/local/ldap/include -I/usr/local/mysql/include/mysq
l -I/export/home/oracle/rdbms/public -I/export/home/oracle/rdbms/demo -I/export/
home/oracle/network/public -I/home/majid/src/php-4.1.2/ext/xml/expat  -D_POSIX_P
THREAD_SEMANTICS -DSOLARIS2=280 -DMOD_SSL=208106 -DEAPI -DEAPI_MM -DUSE_EXPAT -I
/home/majid/src/php-4.1.2/TSRM -g -DEAPI -prefer-pic   -o libphp4.la -rpath /hom
e/majid/src/php-4.1.2/libs -export-symbols /home/majid/src/php-4.1.2/sapi/apache
/php.sym -avoid-version -L/usr/ucblib -L/usr/local/lib/gcc-lib/i386-pc-solaris2.
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 /usr/local/lib/gcc-lib/i386-pc-solaris
2.8/2.95.2 -R /usr/local/lib -R /usr/local/ldap/lib -R /usr/local/mysql/lib/mysq
l -R /export/home/oracle/lib stub.lo  Zend/libZend.la  sapi/apache/libsapi.la  m
ain/libmain.la  regex/libregex.la  ext/gd/libgd.la ext/imap/libimap.la ext/ldap/
libldap.la ext/mhash/libmhash.la ext/mysql/libmysql.la ext/oci8/liboci8.la ext/p
cre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libs
tandard.la ext/xml/libxml.la  TSRM/libtsrm.la -L/usr/local/ldap/lib -L/usr/local
/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



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-21 15:45 UTC] venaas@php.net
Since you got Oracle with LDAP support, you could also 
use that instead of OpenLDAP. To use Oracle for LDAP
you write something like
--with-ldap=/usr/local/oracle/product/8.1.6


 [2002-06-21 18:39 UTC] fmajid at kefta dot com
This does indeed fix the ldap_modify_s problem, at least with 4.2.1, although libphp4.so is still linked with the Solaris standard /usr/lib/liblber.so.
 [2002-06-21 18:41 UTC] fmajid at kefta dot com
Closed the bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC