https://issues.apache.org/bugzilla/show_bug.cgi?id=51884

             Bug #: 51884
           Summary: Apache child segfaults when PHP makes LDAP calls
           Product: Apache httpd-2
           Version: 2.2.21
          Platform: PC
        OS/Version: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_ldap
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


When Apache attempts to load a page where PHP makes any LDAP calls
(ldap_connect is typically the function that leads to failure here), the child
process (or main process in no-thread mode) throws a segmentation fault and
dies.  I wrote a test PHP script to connect to our LDAP server and pull down
some basic information.  Apache segfaults when I load this page as well, but if
I run this directly through PHP's CLI parser, it succeeds immediately.  As far
as I can tell, my config is proper.  Upon failure, the error reported by all
browsers I've tested is an HTTP 324 (ERR_EMPTY_RESPONSE).

Running on Solaris 10 with the latest patches applied.  httpd is version
2.2.21, compiled from source.  Here are my configure strings:

OpenLDAP 2.4.23: ./configure --prefix=/opt/utsawebstack/lib/ --disable-slapd
--disable-slurpd

Apache httpd 2.2.21: ./configure --prefix=/opt/utsawebstack/apache2 --with-ldap
--enable-auth-ldap=shared --enable-ldap=shared --enable-headers=shared
--enable-mime-magic=shared --enable-proxy=shared --enable-rewrite=shared
--enable-mods-shared --enable-ssl=shared --with-z=/opt/utsawebstack/lib

PHP 5.3.8: ./configure --prefix=/opt/utsawebstack/php
--with-apxs2=/opt/utsawebstack/apache2/bin/apxs
--with-zlib=/opt/utsawebstack/lib --with-curl=/opt/utsawebstack/lib
--with-iconv=/opt/utsawebstack/lib --with-ldap=/opt/utsawebstack/lib
--enable-calendar --with-mysql=mysqlnd --with-mysqli=mysqlnd --enable-sockets
--enable-zip --with-pear -with-mcrypt=/opt/utsawebstack/lib --enable-mbstring

### Single User Mode -> load test script
# ./httpd -X
httpd: Could not reliably determine the server's fully qualified domain name,
using 10.9.11.163 for ServerName
Segmentation Fault

### error_log output with 'LogLevel debug'
### This output comes from a test where I launch httpd
### load the failing test page, then stop httpd


[Fri Sep 23 09:38:43 2011] [info] Init: Seeding PRNG with 136 bytes of entropy
[Fri Sep 23 09:38:43 2011] [info] Init: Generating temporary RSA private keys
(512/1024 bits)
[Fri Sep 23 09:38:43 2011] [info] Init: Generating temporary DH parameters
(512/1024 bits)
[Fri Sep 23 09:38:43 2011] [debug] ssl_scache_dbm.c(408): Inter-Process Session
Cache (DBM) Expiry: old: 0, new: 0, removed: 0
[Fri Sep 23 09:38:43 2011] [info] Init: Initializing (virtual) servers for SSL
[Fri Sep 23 09:38:43 2011] [info] mod_ssl/2.2.21 compiled against Server:
Apache/2.2.21, Library: OpenSSL/0.9.7d
[Fri Sep 23 09:38:43 2011] [debug] util_ldap.c(1990): LDAP merging Shared Cache
conf: shm=0x812ff30 rmm=0x812ff60 for VHOST: stacker.it.utsa.edu
[Fri Sep 23 09:38:43 2011] [debug] util_ldap.c(1990): LDAP merging Shared Cache
conf: shm=0x812ff30 rmm=0x812ff60 for VHOST: stacker.it.utsa.edu
[Fri Sep 23 09:38:43 2011] [info] APR LDAP: Built with Sun Microsystems Inc.
LDAP SDK
[Fri Sep 23 09:38:43 2011] [info] LDAP: SSL support unavailable: LDAP:
ldapssl_client_init() failed.
[Fri Sep 23 09:38:43 2011] [info] Init: Seeding PRNG with 136 bytes of entropy
[Fri Sep 23 09:38:43 2011] [info] Init: Generating temporary RSA private keys
(512/1024 bits)
[Fri Sep 23 09:38:43 2011] [info] Init: Generating temporary DH parameters
(512/1024 bits)
[Fri Sep 23 09:38:43 2011] [debug] ssl_scache_dbm.c(408): Inter-Process Session
Cache (DBM) Expiry: old: 0, new: 0, removed: 0
[Fri Sep 23 09:38:43 2011] [info] Init: Initializing (virtual) servers for SSL
[Fri Sep 23 09:38:43 2011] [info] mod_ssl/2.2.21 compiled against Server:
Apache/2.2.21, Library: OpenSSL/0.9.7d
[Fri Sep 23 09:38:43 2011] [warn] pid file
/opt/utsawebstack/apache2/logs/httpd.pid overwritten -- Unclean shutdown of
previous Apache run?
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19842 for worker proxy:reverse
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19842 for (*)
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19843 for worker proxy:reverse
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19843 for (*)
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19844 for worker proxy:reverse
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19844 for (*)
[Fri Sep 23 09:38:43 2011] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21
OpenSSL/0.9.7d PHP/5.3.8 configured -- resuming normal operations
[Fri Sep 23 09:38:43 2011] [info] Server built: Sep 22 2011 16:58:51
[Fri Sep 23 09:38:43 2011] [debug] prefork.c(1023): AcceptMutex: pthread
(default: pthread)
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19845 for worker proxy:reverse
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19845 for (*)
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19846 for worker proxy:reverse
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:43 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19846 for (*)
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19851 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19851 for (*)
[Fri Sep 23 09:38:48 2011] [info] removed PID file
/opt/utsawebstack/apache2/logs/httpd.pid (pid=19841)
[Fri Sep 23 09:38:48 2011] [notice] caught SIGTERM, shutting down
[Fri Sep 23 09:38:48 2011] [info] Init: Seeding PRNG with 136 bytes of entropy
[Fri Sep 23 09:38:48 2011] [info] Init: Generating temporary RSA private keys
(512/1024 bits)
[Fri Sep 23 09:38:48 2011] [info] Init: Generating temporary DH parameters
(512/1024 bits)
[Fri Sep 23 09:38:48 2011] [debug] ssl_scache_dbm.c(408): Inter-Process Session
Cache (DBM) Expiry: old: 0, new: 0, removed: 0
[Fri Sep 23 09:38:48 2011] [info] Init: Initializing (virtual) servers for SSL
[Fri Sep 23 09:38:48 2011] [info] mod_ssl/2.2.21 compiled against Server:
Apache/2.2.21, Library: OpenSSL/0.9.7d
[Fri Sep 23 09:38:48 2011] [debug] util_ldap.c(1990): LDAP merging Shared Cache
conf: shm=0x812ff30 rmm=0x812ff60 for VHOST: stacker.it.utsa.edu
[Fri Sep 23 09:38:48 2011] [debug] util_ldap.c(1990): LDAP merging Shared Cache
conf: shm=0x812ff30 rmm=0x812ff60 for VHOST: stacker.it.utsa.edu
[Fri Sep 23 09:38:48 2011] [info] APR LDAP: Built with Sun Microsystems Inc.
LDAP SDK
[Fri Sep 23 09:38:48 2011] [info] LDAP: SSL support unavailable: LDAP:
ldapssl_client_init() failed.
[Fri Sep 23 09:38:48 2011] [info] Init: Seeding PRNG with 136 bytes of entropy
[Fri Sep 23 09:38:48 2011] [info] Init: Generating temporary RSA private keys
(512/1024 bits)
[Fri Sep 23 09:38:48 2011] [info] Init: Generating temporary DH parameters
(512/1024 bits)
[Fri Sep 23 09:38:48 2011] [debug] ssl_scache_dbm.c(408): Inter-Process Session
Cache (DBM) Expiry: old: 0, new: 0, removed: 0
[Fri Sep 23 09:38:48 2011] [info] Init: Initializing (virtual) servers for SSL
[Fri Sep 23 09:38:48 2011] [info] mod_ssl/2.2.21 compiled against Server:
Apache/2.2.21, Library: OpenSSL/0.9.7d
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19857 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19857 for (*)
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19858 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19858 for (*)
[Fri Sep 23 09:38:48 2011] [notice] Apache/2.2.21 (Unix) mod_ssl/2.2.21
OpenSSL/0.9.7d PHP/5.3.8 configured -- resuming normal operations
[Fri Sep 23 09:38:48 2011] [info] Server built: Sep 22 2011 16:58:51
[Fri Sep 23 09:38:48 2011] [debug] prefork.c(1023): AcceptMutex: pthread
(default: pthread)
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19859 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19859 for (*)
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19860 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19860 for (*)
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1818): proxy: grabbed
scoreboard slot 0 in child 19861 for worker proxy:reverse
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1837): proxy: worker
proxy:reverse already initialized
[Fri Sep 23 09:38:48 2011] [debug] proxy_util.c(1934): proxy: initialized
single connection worker 0 in child 19861 for (*)
[Fri Sep 23 09:38:56 2011] [info] removed PID file
/opt/utsawebstack/apache2/logs/httpd.pid (pid=19856)
[Fri Sep 23 09:38:56 2011] [notice] caught SIGTERM, shutting down

Any ideas?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to