Here is the weird part - the problem is difficult to reproduce,
unless you set your system clock to certain times on May 25, 2009.
For example, I can reproduce the problem 100% of the time when I set
my system clock to May 25, 2009 at 2:00 PM. When my system clock
has other dates, the problem is very difficult to reproduce. In
fact, if I switch my system clock back and forth between May 25,
2009 at 2:00 PM and May 26, 2009 at 2:00 PM while repeatedly running
slapadd with quick mode (-q) and continue-on-error (-c), the problem
always occurs on May 25 but never on May 26.
Try setting breakpoints to see which case is causing alock_close to
fail? Alock should not be particularly time-dependent.