dockerldapmallocopenldapcalloc

openldap ch_calloc core dump in docker containers


With docker 24, in the debian docker image, running openldap results in a malloc segmentation fault. Even a simple version check:

$ docker run --rm -it --entrypoint bash debian
# apt update && env DEBIAN_FRONTEND=noninteractive apt install --yes slapd
# slapd -V
@(#) $OpenLDAP: slapd 2.4.57+dfsg-3+deb11u1 (May 14 2022 18:32:57) $
Debian OpenLDAP Maintainers <pkg-openldap-devel@lists.alioth.debian.org>

slapd: ../../../../servers/slapd/ch_malloc.c:107: ch_calloc: Assertion `0' failed.
Aborted (core dumped)

Then obviously trying to launch the server with something like slapd -F /tmp/slapd -h ldap://:639/ -d -1 also fails with a core dump.

Is this an upstream bug or a docker misconfiguration?


Solution

  • Setting a smaller open files limit, like for instance executing ulimit -n 1024 before running slapd solves the issue.