Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 May 2012 01:55:08 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "Hartmann, O." <ohartman@zedat.fu-berlin.de>
Cc:        freebsd-current@freebsd.org, freebsd-questions@freebsd.org, David Xu <davidxu@FreeBSD.org>
Subject:   Re: OpenLDAP 2.4.31 on FreeBSD 10.0-CURRENT/amd64 broken!
Message-ID:  <4FA5BDDC.4050307@FreeBSD.org>
In-Reply-To: <4FA54D4A.4050703@zedat.fu-berlin.de>
References:  <4FA54D4A.4050703@zedat.fu-berlin.de>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------070005000407080202000300
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 2012-05-05 17:54, Hartmann, O. wrote:
> Since Friday, I have on all of our FreeBSD 10.0-CURRENT/amd64 boxes
> massive trouble with net/openldap24-server (SASL enabled, so it is
> openldap-sasl-server).
> 
> Last time OpenLDAP worked was Thursday last week, when obviously a
> problematic update to the OS was made

I managed to reproduce the segfault you are seeing in slapd, which is
caused by a problem in libthr.so, introduced in r234947.

Please apply the attached diff, rebuild lib/libthr and install it, and
then try your slapd tests again.  Let us know. :)

@David, can you please review this diff?  It looks like there was a
mistake merging from Perforce, where you also moved the line:

                sc = SC_LOOKUP(wchan);

to the top of the _sleepq_add() function, just before the call to
_sleepq_lookup().  If this isn't done, sc may be uninitialized when it
is dereferenced later on in the function.

--------------070005000407080202000300
Content-Type: text/x-diff;
 name="libthr-segfault-1.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="libthr-segfault-1.diff"

Index: lib/libthr/thread/thr_sleepq.c
===================================================================
--- lib/libthr/thread/thr_sleepq.c	(revision 234994)
+++ lib/libthr/thread/thr_sleepq.c	(working copy)
@@ -113,11 +113,11 @@ _sleepq_add(void *wchan, struct pthread *td)
 	struct sleepqueue_chain *sc;
 	struct sleepqueue *sq;
 
+	sc = SC_LOOKUP(wchan);
 	sq = _sleepq_lookup(wchan);
 	if (sq != NULL) {
 		SLIST_INSERT_HEAD(&sq->sq_freeq, td->sleepqueue, sq_flink);
 	} else {
-		sc = SC_LOOKUP(wchan);
 		sq = td->sleepqueue;
 		LIST_INSERT_HEAD(&sc->sc_queues, sq, sq_hash);
 		sq->sq_wchan = wchan;

--------------070005000407080202000300--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FA5BDDC.4050307>