NetBSD Problem Report #24473

Received: (qmail 25584 invoked by uid 605); 18 Feb 2004 14:50:58 -0000
Message-Id: <20040218145046.6D7825613@bart.stasoft.ch>
Date: Wed, 18 Feb 2004 15:50:46 +0100 (CET)
From: jukka-netbsd@2004.salmi.ch
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: jukka-netbsd@2004.salmi.ch
To: gnats-bugs@gnats.netbsd.org
Subject: databases/openldap: slapd segfaults
X-Send-Pr-Version: 3.95

>Number:         24473
>Category:       pkg
>Synopsis:       databases/openldap: slapd segfaults
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Feb 18 14:51:00 +0000 2004
>Closed-Date:    Fri Feb 20 23:00:27 +0000 2004
>Last-Modified:  Fri Feb 20 23:00:27 +0000 2004
>Originator:     Jukka Salmi
>Release:        NetBSD 1.6.2
>Organization:
>Environment:
System: NetBSD bart.stasoft.ch 1.6.2 NetBSD 1.6.2 (BART) #0: Tue Feb 10 10:29:57 CET 2004 root@bart.stasoft.ch:/usr/src/sys/arch/i386/compile/BART i386
Architecture: i386
Machine: i386
>Description:
On a stable NetBSD system using current pkgsrc, databases/openldap builds without problems, but slapd segfaults when started:

$ gdb slapd
GNU gdb 5.0nb1
[...]
This GDB was configured as "i386--netbsdelf"...
(gdb) run
Starting program: /opt/pkgbuild/databases/openldap/work/openldap-2.1.25/servers/slapd/slapd 

Program received signal SIGSEGV, Segmentation fault.
0x811410a in __pth_ring_append ()
(gdb) bt
#0  0x811410a in __pth_ring_append ()
#1  0x810f406 in pth_mutex_acquire ()
#2  0x80d5072 in ldap_pvt_thread_mutex_lock (mutex=0x814d058) at thr_pth.c:134
#3  0x80ed8e0 in ldap_pvt_gethostbyname_a (name=0xbfbfd7d0 "bart.stasoft.ch", 
    resbuf=0xbfbfd7b8, buf=0xbfbfd8d4, result=0xbfbfd7cc, 
    herrno_ptr=0xbfbfd7b0) at util-int.c:157
#4  0x80edee0 in ldap_pvt_get_fqdn (name=0xbfbfd7d0 "bart.stasoft.ch")
    at util-int.c:530
#5  0x80ec520 in ldap_int_initialize (gopts=0x813df20, dbglvl=0x813c674)
    at init.c:525
#6  0x80ece30 in ldap_set_option (ld=0x0, option=20481, invalue=0x813c674)
    at options.c:338
#7  0x804c476 in main (argc=1, argv=0xbfbfda1c) at main.c:311
#8  0x804bea0 in ___start ()
(gdb) 

openldap was built as follows (excerpt from config.status.overridden):
# ./configure  --sysconfdir=/usr/pkg/etc/openldap --localstatedir=/var/openldap
--enable-bdb --enable-crypt --enable-dnssrv --enable-ldap --enable-ldbm
--enable-passwd --enable-wrappers --with-tls=openssl --without-readline
--with-cyrus-sasl --enable-spasswd --without-kerberos --with-threads=pth
--host=i386--netbsdelf --prefix=/usr/pkg

>How-To-Repeat:
with a current pkgsrc, do:
$ cd databases/openldap && make build &&
	./work/openldap-2.1.25/servers/slapd/slapd
>Fix:
>Release-Note:
>Audit-Trail:

From: Jukka Salmi <jukka-netbsd@2004.salmi.ch>
To: gnats-bugs@netbsd.org
Cc:  
Subject: Re: pkg/24473: databases/openldap: slapd segfaults
Date: Thu, 19 Feb 2004 15:08:00 +0100

 slapd segfaults only on stable NetBSD systems; I just built OpenLDAP 2.1.25
 on -current, and slapd starts and runs without problems. I think it's a
 pth related problem.

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~

From: "Johnny C. Lam" <jlam@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/24473 CVS commit: pkgsrc/databases/openldap
Date: Thu, 19 Feb 2004 14:42:39 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jlam
 Date:		Thu Feb 19 14:42:39 UTC 2004

 Modified Files:
 	pkgsrc/databases/openldap: Makefile PLIST

 Log Message:
 If the threads are non-native, then don't build openldap with threads
 support.  The slapd built without threads passes all of its test except
 for the replication test, which is because slurpd is not built (slurpd
 requires threads).  Bump the PKGREVISION.

 This is in response to PR 24473.  As a debugging aid in case someone
 attempts to really fix the PR, if _OPENLDAP_REQUIRE_THREADS is "yes",
 then openldap will forcibly build using GNU pth if native threads
 aren't available.


 To generate a diff of this commit:
 cvs rdiff -r1.68 -r1.69 pkgsrc/databases/openldap/Makefile
 cvs rdiff -r1.12 -r1.13 pkgsrc/databases/openldap/PLIST

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->analyzed 
State-Changed-By: jlam 
State-Changed-When: Thu Feb 19 15:00:11 UTC 2004 
State-Changed-Why:  
The problem is either something in pth or in how the OpenLDAP code uses 
pth.  In any case, I've worked around the problem by not compiling using 
pth if native threads aren't available.  The resulting slapd passes all 
of its tests. 
State-Changed-From-To: analyzed->feedback 
State-Changed-By: jlam 
State-Changed-When: Fri Feb 20 13:56:36 UTC 2004 
State-Changed-Why:  
I've recently committed a fix by Nick Hudson to the openldap package that 
should fix this problem with using GNU pth on NetBSD 1.6.2 systems.  Could 
you please test with an updated package and let me know the results? 
Thanks! 

From: "Johnny C. Lam" <jlam@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/24473 CVS commit: pkgsrc/databases/openldap
Date: Fri, 20 Feb 2004 13:56:15 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jlam
 Date:		Fri Feb 20 13:56:15 UTC 2004

 Modified Files:
 	pkgsrc/databases/openldap: Makefile distinfo
 Added Files:
 	pkgsrc/databases/openldap/patches: patch-ah

 Log Message:
 Reenable the use of GNU pth on systems without native pthreads.  Bump
 the PKGREVISION.  The fix was provided by Nick Hudson and modifies
 the libldap initialization routine to call the GNU pth initialization
 routine before using it.  The resulting slapd/slurpd passes the test
 suite included in the OpenLDAP sources.  This fixes PR 24473.


 To generate a diff of this commit:
 cvs rdiff -r1.69 -r1.70 pkgsrc/databases/openldap/Makefile
 cvs rdiff -r1.22 -r1.23 pkgsrc/databases/openldap/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/databases/openldap/patches/patch-ah

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Jukka Salmi <jukka-netbsd@2004.salmi.ch>
To: gnats-bugs@gnats.netbsd.org
Cc: jlam@netbsd.org
Subject: Re: pkg/24473
Date: Fri, 20 Feb 2004 15:47:50 +0100

 jlam@netbsd.org wrote:
 > I've recently committed a fix by Nick Hudson to the openldap package that
 > should fix this problem with using GNU pth on NetBSD 1.6.2 systems.  Could
 > you please test with an updated package and let me know the results?

 Done, works fine. Thanks!

 Jukka

 -- 
 bashian roulette:
 $ ((RANDOM%6)) || rm -rf ~
State-Changed-From-To: feedback->closed 
State-Changed-By: jlam 
State-Changed-When: Fri Feb 20 22:59:35 UTC 2004 
State-Changed-Why:  
PR submitter confirms that the fix proposed by Nick Hudson solves the 
segfaulting problem.  Thanks for the PR! 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.