ds crashes occasionally hen performing a cn=monitor search.
his bug was reported in bz1203338, details there.
The core issue is in libdb, see: bz 1211871, but it could eventually fixed in DS by prebvening db_open calls and memp_stat calls to run in parallel
I wrote a lib389 test and got the following crash:
Core was generated by `./ns-slapd -D /root/389TEST/install/etc/dirsrv/slapd-standalone -i /root/389TES'. Program terminated with signal SIGABRT, Aborted.
Missing separate debuginfos, use: debuginfo-install audit-libs-2.4-1.fc20.x86_64 cyrus-sasl-gssapi-2.1.26-14.fc20.x86_64 cyrus-sasl-lib-2.1.26-14.fc20.x86_64 cyrus-sasl-md5-2.1.26-14.fc20.x86_64 glibc-2.18-14.fc20.x86_64 keyutils-libs-1.5.9-1.fc20.x86_64 krb5-libs-1.11.5-11.fc20.x86_64 libcom_err-1.42.8-3.fc20.x86_64 libdb-5.3.28-1.fc20.x86_64 libgcc-4.8.3-7.fc20.x86_64 libicu-50.1.2-11.fc20.x86_64 libselinux-2.2.1-6.fc20.x86_64 libstdc++-4.8.3-7.fc20.x86_64 nspr-4.10.7-1.fc20.x86_64 nss-3.17.0-1.fc20.x86_64 nss-softokn-3.17.0-1.fc20.x86_64 nss-softokn-freebl-3.17.0-1.fc20.x86_64 nss-util-3.17.0-1.fc20.x86_64 openssl-libs-1.0.1e-39.fc20.x86_64 pam-1.1.8-1.fc20.x86_64 pcre-8.33-6.fc20.x86_64 sqlite-3.8.6-2.fc20.x86_64 svrcore-4.0.4-10.fc20.x86_64 xz-libs-5.1.2-12alpha.fc20.x86_64 zlib-1.2.8-3.fc20.x86_64 (gdb) bt
at /root/389TEST/workspaces/389-ds-base/ds/ldap/servers/slapd/back-ldbm/monitor.c:260
returncode=returncode@entry=0x7f9bb27f4c84, returntext=returntext@entry=0x7f9bb27f4f00 "", pdse=<optimized out>) at /root/389TEST/workspaces/389-ds-base/ds/ldap/servers/slapd/dse.c:2663
at /root/389TEST/workspaces/389-ds-base/ds/ldap/servers/slapd/dse.c:1675
(gdb) f 5
260 slapi_ch_free((void **)&mpfstat);
This looks very close to the customer crash
attachment 0001-testcase-for-ticket-48149.patch
with the attached test script I did get a crash in 5 out of 10 runs I produced 10 crahses with 7 different stack traces, but all in malloc and related to ldbm_back_monitor_instance search. That we see different crash location is quite usual for heap corruptions
attachment 0001-Ticket-48149-ns-slapd-double-free-or-corruption-cras.patch
attachment 0002-Ticket-48149-test-for-ns-slapd-double-free-or-corrup.patch
attachment 0002-Ticket-48149-test-for-ns-slapd-double-free-or-corrup.2.patch
{{{ 105 #define DB_OPEN(priv, oflags, db, txnid, file, database, type, flags, mode, rval) \ ... 109 if ((priv)) slapi_rwlock_rdlock((priv)->dblayer_env_lock); \ 109 110 (rval) = ((db)->open)((db), (txnid), (file), (database), (type), (flags)|DB_AUTO_COMMIT, (mode)); \ 111 if ((priv)) slapi_rwlock_unlock((priv)->dblayer_env_lock); \ }}} Should this be "env" instead of "priv"?
well it is of type 'struct dblayer_private_env *', so I called it priv, but maybe it could be penv
Replying to [comment:9 lkrispen]:
Ok. I was just confused because everywhere DB_OPEN is used, the first argument is pENV or mypENV, and here the argument is env instead of priv: {{{ 125 #define DB_OPEN(env, oflags, db, txnid, file, database, type, flags, mode, rval) \ }}}
If it should be priv for the first definition of DB_OPEN, that's fine.
git patch file (1.2.11 branch) -- fixing a coverity defect 0001-Ticket-48149-ns-slapd-double-free-or-corruption-cras.2.patch
This issue is taken care in 1.2.11. This is not a problem in 1.3.3 and newer since libdb has the fix.
Closing this ticket. Thanks, Ludwig!
Metadata Update from @lkrispen: - Issue assigned to lkrispen - Issue set to the milestone: 1.2.11.33
389-ds-base is moving from Pagure to Github. This means that new issues and pull requests will be accepted only in 389-ds-base's github repository.
This issue has been cloned to Github and is available here: - https://github.com/389ds/389-ds-base/issues/1480
If you want to receive further updates on the issue, please navigate to the github issue and click on subscribe button.
subscribe
Thank you for understanding. We apologize for all inconvenience.
Metadata Update from @spichugi: - Issue close_status updated to: wontfix (was: Fixed)