php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15042 PHP crash under ldap_connect() call
Submitted: 2002-01-15 06:06 UTC Modified: 2002-01-28 12:16 UTC
From: g dot delpapa at isa dot it Assigned:
Status: Closed Package: LDAP related
PHP Version: 4.0.6 OS: AIX 4.3.2.0
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 + 45 = ?
Subscribe to this entry?

 
 [2002-01-15 06:06 UTC] g dot delpapa at isa dot it
Hi at all.
This is the question in brief. I have compiled PHP with iPlanet 5.0 LDAP libraries but PHP crash when ldap_connect() function is call.
Here is the environment:

#########################
OS      :       AIX 4.3.2
PHP     :       4.0.6
Apache  :       1.3.20
GCC     :       2.95.3
LDAP    :       iPlanet Directory SDK for C 5.0
LDAP Server     : iPlanet 5.0 on a win2000 Server machine, running and tested with a RedHat7.1 box/apache 1.3.19/php 4.0.4pl1 (compiled from RedHat distribution)

CONFIGURE:

./configure \
        --with-config-file-path=/etc/php \
        --with-apxs=/usr/local/apache/bin/apxs \
        --with-mysql=/usr/local \
        --with-mm=/usr/local \
        --with-readline=/usr/local \
        --with-imap=/usr/local/lib/imap \
        --with-ldap=/usr/local/lib/ldap \
        --with-regex=system \
        --with-zlib=/usr/local \
        --enable-ftp \
        --with-xml

#########################


After "configure", before "make", I've edited the libtool file and add
\${wl}-bI:/usr/local/apache/libexec/httpd.exp
at
archive_cmds and uarchive_expsym_cmds lines.
Without this item compiling process is OK but Apache crash every PHP call

Howhever, all OK at compile time.
All PHP function work fine and all seems to be OK but ... where i call LDAP function it doesnt work. In apache error-log it looks like this:

[ ....] [notice] child pid 16402 exit signal Segmentation Fault (11)
[ ....] [notice] child pid 11340 exit signal Segmentation Fault (11)

Here is the backtrace with gdb 5.0.0:

#############################################
Prgram terminated with signal 11, Segmentation fault.
#0  0xd435f0dc in ldap_open ()
(gdb) bt
#0  0xd435f0dc in ldap_open ()
#1  0xd4358b8c in php_if_ldap_connect (ht=1, return_value=0x20129350, 
    this_ptr=0x200ec360, return_value_used=1) at ldap.c:388
#2  0xd42aa964 in execute ()
#3  0xd427bd7c in zend_execute_scripts (type=538088192, file_count=3)
    at zend.c:752
#4  0xd42bb63c in php_execute_script (primary_file=0x2ff22820) at main.c:1206
#5  0xd44039bc in apache_php_module_main (r=0x20129300, display_source_mode=0)
    at sapi_apache.c:89
#6  0xd440605c in send_php (r=0x201210b0, display_source_mode=0, filename=0x0)
    at mod_php4.c:536
#7  0xd44060c4 in send_parsed_php (r=0x20129300) at mod_php4.c:547
#8  0x10015874 in ap_invoke_handler ()
#9  0x1004209c in process_request_internal ()
#10 0x10042160 in ap_process_request ()
#11 0x10005500 in child_main ()
#12 0x10005870 in make_child ()
#13 0x100059a4 in startup_children ()
#14 0x1000626c in standalone_main ()
#15 0x10006cd0 in main ()
#16 0x100001dc in __start ()
(gdb)
#############################################

ldap_open() seems to be a deprecated function from SDK API documentation.
I've tried to change in ldap.c at line 388 ldap_open() in ldap_init() but there's no change in result. This is the gdb backtrace:

############################################
Program terminated with signal 11, Segmentation fault.
#0  0xd435f0dc in ldap_init ()
(gdb) bt
#0  0xd435f0dc in ldap_init ()
#1  0xd4358b8c in php_if_ldap_connect (ht=1, return_value=0x20129350, 
    this_ptr=0x200ec360, return_value_used=1) at ldap.c:388
#2  0xd42aa964 in execute ()
#3  0xd427bd7c in zend_execute_scripts (type=538088192, file_count=3)
    at zend.c:752
#4  0xd42bb63c in php_execute_script (primary_file=0x2ff22840) at main.c:1206
#5  0xd44039bc in apache_php_module_main (r=0x20129300, display_source_mode=0)
    at sapi_apache.c:89
#6  0xd440605c in send_php (r=0x201210b0, display_source_mode=0, filename=0x0)
    at mod_php4.c:536
#7  0xd44060c4 in send_parsed_php (r=0x20129300) at mod_php4.c:547
#8  0x10015874 in ap_invoke_handler ()
#9  0x1004209c in process_request_internal ()
#10 0x10042160 in ap_process_request ()
#11 0x10005500 in child_main ()
#12 0x10005748 in make_child ()
#13 0x100059a4 in startup_children ()
#14 0x1000626c in standalone_main ()
#15 0x10006cd0 in main ()
#16 0x100001dc in __start ()
(gdb)
############################################

I've tried all with php 4.1.1 too but here I report an error in installation process ("make install"): 
file libphph4.so not found in /u/sw/php-4.1.1/libs.
The file is still in /u/sw/php-4.1.1/.libs
If I copy manually the file in /libs installation process is Ok, php work fine but anyway .... no LDAP!
Any idea?
Thank you in advance for support ... :)

Gianni

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-28 12:11 UTC] g dot delpapa at isa dot it
Ok guys, nothing appear on this side and so .... I solve from myself ... Here is the solution:

A deep analysis of configure file suggest me that highest level of supported iPlanet libraries is 4.1. Why my compile time with 5.0 was OK? I don't know.
Ok, I've used the 4.1 libraries but I've reported a lot of compile error like "libraries not found"!
All iPlanet libraries are xxx.so.
I rename all libraries in xxx.a and all work fine. Aix problem? Php problem? I don't know but .... it work and I've saved my job! :)
I post this message for information for someone other desperate on AIX platform ... :)
Closed this bug for me
Have a nice net
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC