mDNS crashes Samba


Wow. This was a weird one that ended causing me to use my feeble knowledge of gdb figure out whats going on.

I’ve been messing around with the best way to integrate my Debian GNU/Linux desktop with the Active Directory network at work. Some recommended that I re-run the net ads join command, but I kept getting a Segmentation fault error after entering my password!

A few minutes of toying with gdb –args net ads join and the bt (backtrace) command showed me the crash was in libnss_mdns! libnss_mdns is the multicast DNS name resolution service used by Avahi. mDNS uses the .local domain and our Active Directory uses the tremont.local domain name, so I wonder if there’s some sort of conflict…

After removing all mention of mdns and minimal_mdns from my /etc/nsswitch.conf file, net ads join ran perfectly.

Here’s the backtrace for anyone interested (or googling):

#0 0x0816e15d in timeval_add ()
#1 0xb791e76b in avahi_resolve_address () from /usr/lib/
#2 0xb791ed09 in mdns_query_ipv4 () from /usr/lib/
#3 0xb791c979 in _nss_mdns_gethostbyaddr_r () from /usr/lib/
#4 0xb7cb6389 in gethostbyaddr_r () from /lib/tls/i686/cmov/
#5 0xb7cbeaac in getnameinfo () from /lib/tls/i686/cmov/
#6 0xb7da9c3a in ldap_pvt_get_hname () from /usr/lib/
#7 0xb7da5007 in ldap_host_connected_to () from /usr/lib/
#8 0xb7d91060 in ldap_int_open_connection () from /usr/lib/
#9 0xb7da3503 in ldap_new_connection () from /usr/lib/
#10 0xb7d90ef1 in ldap_open_defconn () from /usr/lib/
#11 0xb7d91776 in ldap_open () from /usr/lib/
#12 0x081cc341 in ldap_open_with_timeout ()
#13 0x081cc41f in ads_connect ()
#14 0x0807b9b1 in net_ads_check_our_domain ()
#15 0x0807d4bf in net_ads_join ()
#16 0x0807afa9 in net_ads ()
#17 0x0807adea in main ()

I don’t even know where to submit a bug report since (at least) 3 separate projects are referenced in the backtrace: Samba, OpenLDAP (libldap), and Avahi/libnss_mdns. Anyone able to enlighten me?

Update:  Gerald (Jerry) Carter from the Samba Team told someone with a similar experience to report the bug to the Avahi team.  So I did.