asserts and manadatory build instructions (was ITS#8240)
by Michael Ströder
hyc(a)symas.com wrote in ITS#8240:
> Our patch response was too hasty. There is no OpenLDAP bug here, the real
> issue is production binaries being built with asserts enabled instead of
> compiling with -DNDEBUG. That's an issue for packagers and distros to resolve.
> Closing this ITS, not an OpenLDAP bug.
Maybe I missed something. But this is the first time I've heard about -DNDEBUG
being mandatory when compiling binary packages for production use. Does it
have other effects?
And what are general rules for assert statements in OpenLDAP code?
In my own (Python) code assert statements are supposed to be only triggered if
something goes wrong *internally* (type issues etc.). If somebody manages to
trigger an assert statement with invalid input from "outside" I always
consider this to be a serious bug revealing insufficient error handling even
though e.g. web2ldap just logs the exception but won't crash. YMMV, but please
clarify.
I also wonder whether there are more mandatory rules for building packages and
where I can find them.
Please don't get me wrong: My inquiry is in good faith to avoid unnecessary
ITS based on misunderstanding.
Ciao, Michael.
2 years
Debugging left over in test008?
by Quanah Gibson-Mount
After hitting test008 failure on a new system because "time" was not
installed, I looked at test008, and I think the problem is someone was
debugging something years ago, and checked the script in still in that
state:
echo "Using tester for concurrent server access..."
time $SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR" -h $LOCALHOST -p $PORT1 -D
"$MANAGERDN" -w $PASSWD -l $TESTLOOPS
#$SLAPDTESTER -P "$PROGDIR" -d "$TESTDIR" -h $LOCALHOST -p $PORT1 -D
"$MANAGERDN" -w $PASSWD -l $TESTLOOPS
RC=$?
Note the commented out line. The checkin for this change seems to confirm
it was accidental as well, and that all that was intended was the "sleep 1":
quanah@b4c92f65-2064-44a6-9707-a97562610945:~/git/openldap/openldap-head$
git show 572ca2db -- tests/scripts/test008-concurrency
commit 572ca2db94b0e7af95e7ac16a91cb1ea3b3d136a
Author: Howard Chu <hyc(a)openldap.org>
Date: Fri Sep 30 07:32:49 2005 +0000
Tweak slapd startup delays
diff --git a/tests/scripts/test008-concurrency
b/tests/scripts/test008-concurrency
index 3841c33..6ea541f 100755
--- a/tests/scripts/test008-concurrency
+++ b/tests/scripts/test008-concurrency
@@ -36,6 +36,8 @@ if test $WAIT != 0 ; then
fi
KILLPIDS="$PID"
+sleep 1
+
echo "Using ldapsearch to check that slapd is running..."
for i in 0 1 2 3 4 5; do
$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
@@ -49,7 +51,8 @@ for i in 0 1 2 3 4 5; do
done
echo "Using tester for concurrent server access..."
-$SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT1 -D
"$MANAGERDN" -w $PASSWD -l 50
+time $SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT1 -D
"$MANAGERDN" -w $PASSWD -l 50
+#$SLAPDTESTER -P "$PROGDIR" -d "$DATADIR" -h $LOCALHOST -p $PORT1 -D
"$MANAGERDN" -w $PASSWD -l 50
RC=$?
if test $RC != 0 ; then
Are there any objections to me switching these around so that the time line
is commented out instead? ;)
--Quanah
--
Quanah Gibson-Mount
Platform Architect
Zimbra, Inc.
--------------------
Zimbra :: the leader in open source messaging and collaboration
A division of Synacor, Inc
7 years, 7 months