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

Re: slapadd core-dumps when destroying db's env (Sleepycat 3.2.9) (ITS#1239)

ando@sys-net.it wrote:

> Full_Name: Pierangelo Masarati
> Version: HEAD
> OS: Linux RedHat
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (
> I got a crash in test-001 when linking with SleepyCat 3.2.9; there were any
> when using ldbm. I traced the problem down to
>         servers/slapd/back-ldbm/init.c:221:ldbm_back_db_destroy()
> which calls
>         libraries/libldbm/ldbm.c:297:ldbm_shutdown_env()
> with a NULL env; I don't know if the NULL env should be handled at the
> db's side and if it is intended or a bug.  I temporarily patched
> ldbm_back_db_destroy to call ldbm_shutdown_env only if the env is
> not NULL, and all the tests work again; however I don't want to commit
> a patch that hides a potential problem unless someone more familiar
> with the subject confirms it's OK.
> Here' a backtrace of what happened:
> #0  0x807ead1 in ldbm_shutdown_env (env=0x0) at ldbm.c:297
> #1  0x80687e2 in ldbm_back_db_destroy (be=0x816c0b8) at init.c:221
> #2  0x8050626 in backend_destroy () at backend.c:409
> #3  0x8063ec5 in slap_destroy () at init.c:203
> #4  0x8066647 in slap_tool_destroy () at slapcommon.c:247
> #5  0x804c4be in main (argc=5, argv=0x7ffffab4) at slapadd.c:139
> There's no evidence of such failure with ldbm.
> Ando.
> to

Your diagnosis is correct.  ldbm_shutdown_env should not be called if env ==
0.  However, in my tests I have to have multiple LDBM databases defined to get
a crash.  I have committed a fix.