php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10643 PHP 4.0.5 linked against openldap 2.x segfaults on Apache startup
Submitted: 2001-05-03 14:06 UTC Modified: 2001-05-06 21:42 UTC
From: Edwin dot Chiu at e-wares dot com Assigned:
Status: Closed Package: LDAP related
PHP Version: 4.0.5 OS: Linux 2.2.14
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: Edwin dot Chiu at e-wares dot com
New email:
PHP Version: OS:

 

 [2001-05-03 14:06 UTC] Edwin dot Chiu at e-wares dot com
My configure string:

./configure  --prefix=/software/php-4 --with-apxs=/software/apache-1.3/bin/apxs --with-gdbm --with-ldap=/software/openldap-2 --with-pgsql=/software/postgresql-7 --with-config-file-path=/software/php-4/lib

Using OpenLDAP 2.0.7 and PostgreSQL 7.1 on a SuSE 6.4 box.

# ldd libphp4.so 
        libpam.so.0 => /lib/libpam.so.0 (0x40144000)
        libdl.so.2 => /lib/libdl.so.2 (0x4014c000)
        libpq.so.2 => /software/postgresql-7/lib/libpq.so.2 (0x40150000)
        libldap.so.2 => /software/openldap-2/lib/libldap.so.2 (0x4015f000)
        liblber.so.2 => /software/openldap-2/lib/liblber.so.2 (0x40249000)
        libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x40256000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x4025e000)
        libm.so.6 => /lib/libm.so.6 (0x4026d000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x4028a000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x402b7000)
        libc.so.6 => /lib/libc.so.6 (0x402ce000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

Here is an strace of an Apache child that died. I'm using NSS_LDAP and PAM_LDAP.

open("/lib/libpthread.so.0", O_RDONLY)  = 4
fstat(4, {st_mode=S_IFREG|0755, st_size=289663, ...}) = 0
read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\200?\0"..., 4096) = 4096
mmap(NULL, 75832, PROT_READ|PROT_EXEC, MAP_PRIVATE, 4, 0) = 0x405aa000
mprotect(0x405b5000, 30776, PROT_NONE)  = 0
mmap(0x405b5000, 32768, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 4, 0xa000) = 0x405b5000
close(4)                                = 0
mprotect(0x40592000, 90112, PROT_READ|PROT_WRITE) = 0
mprotect(0x40592000, 90112, PROT_READ|PROT_EXEC) = 0
getpid()                                = 15900
getrlimit(RLIMIT_STACK, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0
setrlimit(RLIMIT_STACK, {rlim_cur=2040*1024, rlim_max=RLIM_INFINITY}) = 0
uname({sys="Linux", node="oradev", ...}) = 0
rt_sigaction(SIGRT_0, {0x405b1c60, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {0x405b1d00, [], 0x4000000}, NULL, 8) = 0
rt_sigaction(SIGRT_2, {0x405b1e20, [], 0x4000000}, NULL, 8) = 0
rt_sigprocmask(SIG_BLOCK, [RT_0], NULL, 8) = 0
munmap(0x402c8000, 28943)               = 0
geteuid()                               = 0
getpid()                                = 15900
open("/etc/ldap.conf", O_RDONLY)        = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=213, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
read(4, "# $Id$\n\nhost 192.168.0.1\nbase o="..., 4096) = 213
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40015000, 4096)                = 0
uname({sys="Linux", node="oradev", ...}) = 0
open("/etc/hosts", O_RDONLY)            = 4
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=708, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
read(4, "#\n# hosts         This file desc"..., 4096) = 708
close(4)                                = 0
munmap(0x40015000, 4096)                = 0
getrlimit(RLIMIT_NOFILE, {rlim_cur=1024, rlim_max=1024}) = 0
open("/software/openldap-2/etc/openldap/ldap.conf", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=337, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40015000
read(4, "# $OpenLDAP: pkg/ldap/libraries/"..., 4096) = 337
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40015000, 4096)                = 0
open("/root/ldaprc", O_RDONLY)          = -1 ENOENT (No such file or directory)
open("/root/.ldaprc", O_RDONLY)         = -1 ENOENT (No such file or directory)
open("ldaprc", O_RDONLY)                = -1 ENOENT (No such file or directory)
uname({sys="Linux", node="oradev", ...}) = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 4
ioctl(4, FIONBIO, [1])                  = 0
connect(4, {sin_family=AF_INET, sin_port=htons(389), sin_addr=inet_addr("192.168.0.1")}}, 16) = -1 EINPROGRESS (Operation now in progress)
select(1024, NULL, [4], NULL, NULL)     = 1 (out [4])
getpeername(4, {sin_family=AF_INET, sin_port=htons(389), sin_addr=inet_addr("192.168.0.1")}}, [16]) = 0
ioctl(4, FIONBIO, [0])                  = 0
brk(0x811e000)                          = 0x811e000
time(NULL)                              = 988912101
write(4, "0\f\2\1\1`\7\2\1\2\4\0\200\0", 14) = 14
select(1024, [4], [], NULL, NULL)       = 1 (in [4])
read(4, "0\f\2\1\1a\7\n\1\0\4\0\4\0", 16384) = 14
time(NULL)                              = 988912101
geteuid()                               = 0
getpid()                                = 15900
rt_sigaction(SIGPIPE, {SIG_IGN}, {SIG_IGN}, 8) = 0
getpeername(135365352, 0xbfffef1c, [1025]) = -1 EBADF (Bad file descriptor)
write(4, "0\5\2\1\2B\0", 7)             = 7
--- SIGSEGV (Segmentation fault) ---
chdir("/software/apache-1.3")           = 0
rt_sigaction(SIGSEGV, {SIG_DFL}, {SIG_DFL}, 8) = 0
getpid()                                = 15900
kill(15900, SIGSEGV)                    = 0
sigreturn()                             = ? (mask now [])
--- SIGSEGV (Segmentation fault) ---

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-05-06 12:07 UTC] sniper@php.net
This might be the infamous pthread lib / glibc bug.
Is your Apache linked with pthread?
If not, check the instructions how to do it on
www.php.net/oci8 

(I know, it's Oracle manual page..:)

--Jani

 [2001-05-06 21:42 UTC] Edwin dot Chiu at e-wares dot com
Linking to libpthread in Apache resolved the problem.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 06:01:27 2025 UTC