Sure this bug is introduced by the 4d02c741 (Use a single write txn).
Could be fixed by:
cherry-pick ead57604 (ITS#7961 Re-fix txn init) from
git://git.uio.no/u/hbf/openldap.git
or
revert: d72b2f5d (ITS#7961 fix txn init), 62e4eeb7 (ITS#7943 reinit
txn flags), 891e6627 (Plug leak in 4d02c741...) and 4d02c741 (Use a
single write txn).
Totally fixed? Or are you still seeing the ITS#7968 crash now? So far
I've run your testcase on the patched source (with ead57604) and gotten
no crashes.
--
-- Howard Chu
CTO, Symas Corp.
http://www.symas.com
Director, Highland Sun
http://highlandsun.com/hyc/
Chief Architect, OpenLDAP
http://www.openldap.org/project/