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

Re: (ITS#8472) slapd killed after ldapadd



ondra@mistotebe.net wrote:
> On Fri, Jul 14, 2017 at 09:02:18AM +0000, russell@samknows.com wrote:
>> 59687dbf ch_calloc of 1 elems of 0 bytes failed
>> slapd: ../../../../servers/slapd/ch_malloc.c:107: ch_calloc: Assertion
>> `0' failed.
>> Aborted
> 
> If no indexes remain, mdb_attr_dbs_open calls ch_calloc(1, 0), but
> ch_malloc/ch_calloc do not expect that.
> 
> I'd fix ch_calloc/ch_malloc, but depends whether that's the right thing
> to do, is it intentional to assert when a zero size is requested?

Yes.

> ber_memalloc has an assert there if LDAP_MEMORY_DEBUG has the second bit
> set. Hallvard, Howard?
> 
> If it's fine to change the ch_ functions, then a patch is available at
> ftp://ftp.openldap.org/incoming/Ondrej-Kuznik-20170714-ITS-8472.patch

No.

In this case, back-mdb never expects the number of indexed attributes to be 
zero. (At the least, objectclass must always have an equality index.) back-mdb 
can be patched to avoid this particular crash. But as a rule, you're expected 
to make all changes to the index config in a single Modify op. Not delete all 
the indices in one operation, and then define new indices in a new operation.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/