Bug 198629

Summary: [ldns] Segmentation fault on i386 when /etc/resolv.conf is missing
Product: Base System Reporter: Wout Decré <wout>
Component: binAssignee: Dag-Erling Smørgrav <des>
Status: Closed FIXED    
Severity: Affects Some People CC: Lena, des
Priority: ---    
Version: 10.1-RELEASE   
Hardware: i386   
OS: Any   

Description Wout Decré 2015-03-16 15:23:37 UTC
Using ssh to connect to a host defined in /etc/hosts on a FreeBSD 10.1-RELEASE i386 machine with a missing /etc/resolv.conf file results in a segmentation fault.

Simply creating (an empty) resolv.conf file fixes the problem.

On a amd64 machine, ssh works as expected with or without the resolv.conf file.
Comment 1 Wout Decré 2015-03-20 15:45:40 UTC
The segmentation fault is caused by ldns:

(gdb) bt full
#0  __free (ptr=0x28c00000) at arena.h:504
	usize = <value optimized out>
#1  0x2814e90d in ldns_resolver_deep_free (res=0x28c4556c)
    at /usr/src/lib/libldns/../../contrib/ldns/resolver.c:972
	i = <value optimized out>
#2  0x280b6337 in ssh_getrrsetbyname (hostname=<value optimized out>, rdclass=<value optimized out>, 
    rdtype=<value optimized out>, flags=<value optimized out>)
    at /usr/src/secure/lib/libssh/../../../crypto/openssh/openbsd-compat/getrrsetbyname-ldns.c:246
	res = (struct rrsetinfo **) Cannot access memory at address 0x0
Comment 2 Lena 2015-07-01 04:05:28 UTC
Same if the host is not in /etc/hosts . 10.2-PRERELEASE i386.
Comment 3 Wout Decré 2016-10-18 20:40:16 UTC
This is fixed with r294332, cannot seem to reproduce on 10.3-RELEASE i386 nor 11-RELEASE i386. Thanks