Bug 15652 - dlopen dlz_bind9_xx.so segfaults since Alpine Linux v3.17
Summary: dlopen dlz_bind9_xx.so segfaults since Alpine Linux v3.17
Status: RESOLVED INVALID
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: DNS plugin (BIND DLZ) (show other bugs)
Version: 4.19.6
Hardware: x64 Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Amitay Isaacs
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-29 12:50 UTC by Marvin Adams
Modified: 2024-06-06 18:45 UTC (History)
1 user (show)

See Also:


Attachments
gdb backtrace (8.92 KB, text/plain)
2024-05-29 12:50 UTC, Marvin Adams
no flags Details
valgrind output (3.80 KB, text/plain)
2024-05-29 12:51 UTC, Marvin Adams
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marvin Adams 2024-05-29 12:50:54 UTC
Created attachment 18304 [details]
gdb backtrace

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 (samba-4.16). In Alpine v.3.16 (samba-4.15) it works. Doesn't matter if DC is provisioned or not. It also works with recent version of samba in Gentoo Linux and glibc. So this issue is probably related to musl libc.

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
Comment 1 Marvin Adams 2024-05-29 12:51:51 UTC
Created attachment 18305 [details]
valgrind output
Comment 2 Douglas Bagnall 2024-05-30 01:10:09 UTC
Thanks for the valgrind and gdb info. 

Are those the Samba 4.19.6 / bind 9.18 combination?

looks different to https://bugzilla.samba.org/show_bug.cgi?id=15643.
Comment 3 Marvin Adams 2024-05-30 06:21:03 UTC
(In reply to Douglas Bagnall from comment #2)

yes, i've tested the following combinations:

Alpine/named/samba/result

3.16/9.16.48/4.15.13/works
3.17/9.18.24/4.16.11/fails
3.18/9.18.24/4.18.9/fails
3.19/9.18.24/4.18.9/fails
3.20/9.18.27/4.19.6/fails

There were major changes in heimdal tree in transition from 4.15 to 4.16 (also tree moved to third_party).

Building apk for samba-4.20.1 with abuild failed at first try (NameError: name 'MODE_755' is not defined), but this is another issue i guess.
Comment 4 Marvin Adams 2024-06-06 18:45:55 UTC
building bind against heimdal instead of MIT krb5 solves this issue