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

Re: cannot kill slapd from openldap-1.2.11

Victor Sudakov wrote:
> I have already been contacted by Bryan Mawhinney, this
> indeed seems to be a FreeBSD-specific issue. It is a pity,
> the next release of FreeBSD is not available yet AFAIK.
> Mine is the latest release.
This is a FreeBSD libc_r bug.

Please see:


It's a one line change and a libc_r rebuild & reinstall.

> > Kill -9 is a bad idea (unless there's no other way)
> > as it gives slapd no opportunity to clean up, which
> > could in some cases corrupt your database.
> I understand that. Moreover, slapd works much worse on
> 4.0-RELEASE than it used to on 2.2.8-RELEASE (sad surprise).
> I do a nightly backup of the database by running from cron

[ ... ]

> This worked on 2.2.8-RELEASE. They seem to have seriously
> broken things. Anyway killall does not have anything to do
> with it, it was just an example. kill `cat /var/run/slapd.pid`
> is more ideologically correct.

The problem is system call restart on the select, following
the elect being interrupted by a caught signal.

One could argue that OpenLDAP should be written to be more
platform independant.  In particular, if there were set up
a setjmp in the main loop, and the signal handler set the
flag and did a longjmp, instead of merely setting the flag
and depending on non-restart behaviour, this signal handling
would be portable to about 140 platforms on which I've done
similar code.  As it is, about 60 of those platforms will
exhibit the behaviour you are seeing, and on those platforms,
the behaviour (system call restart following signal trap) is
_correct_ behaviour.

2.2.8 libc_r was brought into strict POSIX threads Draft 4
conformance by Jeremy Allison and myself, in particular for
support of LDAP and ACAP (we also had to patch the STL, which
was not Draft 4 capable, and the Cyrus ACAP server, as well
as the exception handing in g++ 2.95).

FreeBSD 4.x is striving for POSIX standard (non-draft)
conformance, and Jason Evans is doing the work; one might
argue that full conformance with the Draft 4 is better
than partial conformance with the standard.  8-(.  At
least with Draft 4, you know that everything that works
on IRIX and a common release of Tru64 will work on FreeBSD

PS: I reported this bug to Jason Evans, but have not seen
whether or not it was fixed.

PPS: Another way of dealing with this would be for OpenLDAP
to use the POSIX interfaces, rather than the old signal
interfaces.  This would allow the specification of the
sa_flags=0 to defeat restart in all cases, making the code
more determanistic, and less likely to vary in behaviour
from platform to platform.

Let me know if anyone needs help or advice making these
changes; as it is, I am rather swamped for at least the
next 3 weeks...

-- Terry Lambert
-- Whistle Communications, Inc., an I.B.M. Company
-- terry@whistle.com
This is formal notice under California Assembly Bill 1629, enacted
9/26/98 that any UCE sent to my email address will be billed $50
per incident to the legally allowed maximum of $25,000.