[Date Prev][Date Next] [Chronological] [Thread] [Top]

Second instance of slapd segfaults (ITS#2694)



Full_Name: Richard Hanschu
Version: 2.1.22
OS: Debian linux stable
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (208.147.70.129)


Overview: Creating second instance of slapd listening on non-standard port
causes segfault if a instance already exists on port 389.

Environment: Openldap 2.1.22 compiled on linux kernel 2.4.17 with db4.1.25 and
sasl 1.5.27

Issue: Starting a backup/replication ldap server listening on port 3000 first,
then starting standard instance on 389 causes no issues. If instance on port 389
is already running, then the replication server segfaults with following trace:

--SNIP--
read(7, "# $OpenLDAP: pkg/ldap/libraries/"..., 4096) = 337
read(7, "", 4096)                       = 0
close(7)                                = 0
munmap(0x403ec000, 4096)                = 0
getuid32()                              = 0
geteuid32()                             = 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)
socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7
fcntl64(7, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(7, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
connect(7, {sin_family=AF_INET, sin_port=htons(389),
sin_addr=inet_addr("127.0.0.1")}}, 16) = -)
select(1024, NULL, [7], NULL, {30, 0})  = 1 (out [7], left {30, 0})
getpeername(7, {sin_family=AF_INET, sin_port=htons(389),
sin_addr=inet_addr("127.0.0.1")}}, [160
fcntl64(7, F_GETFL)                     = 0x802 (flags O_RDWR|O_NONBLOCK)
fcntl64(7, F_SETFL, O_RDWR)             = 0
getpeername(7, {sin_family=AF_INET, sin_port=htons(389),
sin_addr=inet_addr("127.0.0.1")}}, [160
brk(0x817c000)                          = 0x817c000
brk(0x817f000)                          = 0x817f000
time([1062181377])                      = 1062181377
open("/etc/localtime", O_RDONLY)        = 8
fstat64(8, {st_mode=S_IFREG|0644, st_size=1017, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x403ec000
read(8, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\0\4\0"..., 4096) =
1017
close(8)                                = 0
munmap(0x403ec000, 4096)                = 0
getpid()                                = 5821
rt_sigaction(SIGPIPE, {0x401b2e80, [], 0x4000000}, {SIG_DFL}, 8) = 0
send(3, "<37>Aug 29 11:22:57 slapd[5821]:"..., 54, 0) = 54
rt_sigaction(SIGPIPE, {SIG_DFL}, NULL, 8) = 0
--- SIGSEGV (Segmentation fault) ---
+++ killed by SIGSEGV +++


It looks as if it tries to bind to 127.0.0.1:389 then barfs when it can't.

Command used to start replication server:

#slapd -g ldap -u ldap -h "ldap://0.0.0.0:3000";

-Richard