dlopen dlz_bind9_xx.so segfaults since Alpine Linux v3.17
Package Information
- Package name: samba-dc-libs
- Package version: 4.18.9-r0
- Alpine version: 3.19.1
- Alpine architecture: x86_64
Summary
While setting up a samba DC with bind_dlz i noticed named segfaulting in heim_get_debug_dest() when loading dlz_bind9_18.so. The behaviour is reproducible down to Alpine v3.17. In Alpine v.3.16 it works. Doesn't matter if DC is provisioned or not. It also works with recent version of samba in Gentoo Linux.
Steps to reproduce
- install alpine (tested VM and LXC)
- apk add samba-dc
- apk add bind
- enable dlopen in named.conf:
dlz "AD DNS Zone" { database "dlopen /usr/lib/samba/bind9/dlz_bind9_18.so"; };
- start named
- running gdb bt on /var/bind/core gives:
#0 0x00007f4605c86420 in heim_get_debug_dest () from /usr/lib/samba/libheimbase-samba4.so
#1 0x00007f4605c86f8c in heim_debug () from /usr/lib/samba/libheimbase-samba4.so
#2 0x00007f4605c893ed in heim_plugin_register () from /usr/lib/samba/libheimbase-samba4.so
#3 0x00007f46063ac249 in smb_krb5_init_context_basic () from /usr/lib/samba/libauthkrb5-samba4.so
#4 0x00007f46063ac451 in smb_krb5_init_context () from /usr/lib/samba/libauthkrb5-samba4.so
#5 0x00007f46065d851b in dlz_create () from /usr/lib/samba/bind9/dlz_bind9_18.so
#6 0x00005595472dcdb8 in ?? ()
#7 0x00007f4607aff75f in ?? () from /usr/lib/libdns-9.18.24.so
#8 0x00007f4607a5276d in dns_dlzcreate () from /usr/lib/libdns-9.18.24.so
#9 0x00005595472ecf39 in ?? ()
#10 0x00005595472fa9a7 in ?? ()
#11 0x00005595472fbeee in ?? ()
#12 0x00007f4607c12971 in isc_task_run () from /usr/lib/libisc-9.18.24.so
#13 0x00007f4607be425a in ?? () from /usr/lib/libisc-9.18.24.so
#14 0x00007f4607bea30b in ?? () from /usr/lib/libisc-9.18.24.so
#15 0x00007f4607beab68 in ?? () from /usr/lib/libisc-9.18.24.so
#16 0x00007f4607beb357 in ?? () from /usr/lib/libisc-9.18.24.so
#17 0x00007f4607944d1b in ?? () from /usr/lib/libuv.so.1
#18 0x00007f4607958c08 in ?? () from /usr/lib/libuv.so.1
#19 0x00007f4607945a43 in uv_run () from /usr/lib/libuv.so.1
#20 0x00007f4607bead02 in ?? () from /usr/lib/libisc-9.18.24.so
#21 0x00007f4607c19bf7 in isc.trampoline_run () from /usr/lib/libisc-9.18.24.so
#22 0x00007f4607ca622e in start (p=0x7f4607026a78) at src/thread/pthread_create.c:207
#23 0x00007f4607ca882f in __clone () at src/thread/x86_64/clone.s:22
Backtrace stopped: frame did not save the PC