Bug 219874

Summary: lib/libc/tests/nss/gethostby_test is failing sporadically
Product: Base System Reporter: Enji Cooper <ngie>
Component: testsAssignee: freebsd-testing (Nobody) <testing>
Status: Open ---    
Severity: Affects Some People CC: bdrewery, emaste, lwhsu
Priority: ---    
Version: CURRENT   
Hardware: Any   
OS: Any   

Description Enji Cooper freebsd_committer freebsd_triage 2017-06-08 22:18:47 UTC
I'm running into periodic issues with some of the subtestcases, in particular,
:getipnodebyname_getaddrinfo_ipv6, e.g.,

using getaddrinfo() to resolve localhost
using getaddrinfo() to resolve anoncvs.cirr.com
using getaddrinfo() to resolve anoncvs.netbsd.se
using getaddrinfo() to resolve antioche.antioche.eu.org
using getaddrinfo() to resolve centaurus.4web.cz
using getaddrinfo() to resolve ntp.math.ntnu.no
using getaddrinfo() to resolve console.netbsd.org
using getaddrinfo() to resolve cvs.netbsd.org
using getaddrinfo() to resolve cvsup.netbsd.se
using getaddrinfo() to resolve ftp.chg.ru
using getaddrinfo() to resolve ftp.estpak.ee
using getaddrinfo() to resolve ftp.fsn.hu
using getaddrinfo() to resolve ftp.funet.fi
using getaddrinfo() to resolve ftp.netbsd.org
using getaddrinfo() to resolve ftp.nluug.nl
using getaddrinfo() to resolve ftp.plig.net
using getaddrinfo() to resolve ftp.rrze.uni-erlangen.de
using getaddrinfo() to resolve ftp.xgate.co.kr
using getaddrinfo() to resolve gd.tuwien.ac.at
using getaddrinfo() to resolve gort.ludd.luth.se
using getaddrinfo() to resolve chat.freenode.net
not equal - one of he->h_addr_list couldn't be found
not ok - addrinfo and hostent are not equal

I'm trying to add more logging to determine why the issue is occurring, since
the current information is insufficient.

This has been seen on a Comcast consumer networked machine and multiple Dell EMC networked machines.

The issue might be flaky DNS resolved names/address, intermittent connection issues, or an issue with the resolver software. Not enough information is known at this time to point a specific finger at the root cause.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2018-01-08 04:14:26 UTC
For the following conditions
Product: Base System, Documentation Status: New, Open, In Progress, UNCONFIRMED 
Assignee: Former FreeBSD committer 

Reset to default assignee. Reset status to "Open".
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2019-01-21 21:53:38 UTC
I do not see lib.libc.nss.gethostby_test.getipnodebyname_getaddrinfo_ipv6 fails on ci.freebsd.org for a long time.  I suggest close this ticket and reopen when it fails more often.
Comment 3 Li-Wen Hsu freebsd_committer freebsd_triage 2019-01-24 07:58:00 UTC
This test case runs fine on the new CI infrastructure.
Comment 4 Ed Maste freebsd_committer freebsd_triage 2023-10-25 01:26:08 UTC
reopen, this test is failing fairly regularly for me on a Vultr VM on 14.0-RC2

===> lib/libc/nss/gethostby_test:gethostbyname2_getaddrinfo_ipv6
Result:     failed: /root/freebsd-src/lib/libc/tests/nss/gethostby_test.c:1148: run_tests(_hostlist_file, ((void *)0), 28, TEST_GETHOSTBYNAME2_GETADDRINFO, 0) == 0 not met
Start time: 2023-10-25T00:59:45.889260Z
End time:   2023-10-25T00:59:45.917884Z
Duration:   0.029s

Metadata:
    allowed_architectures is empty
    allowed_platforms is empty
    description is empty
    has_cleanup = false
    is_exclusive = false
    required_configs is empty
    required_disk_space = 0
    required_files is empty
    required_memory = 0
    required_programs is empty
    required_user is empty
    timeout = 300

Standard output:
using getaddrinfo() to resolve localhost
using getaddrinfo() to resolve anoncvs.cirr.com
using getaddrinfo() to resolve anoncvs.netbsd.se
using getaddrinfo() to resolve antioche.antioche.eu.org
using getaddrinfo() to resolve centaurus.4web.cz
using getaddrinfo() to resolve chur.math.ntnu.no
using getaddrinfo() to resolve console.netbsd.org
using getaddrinfo() to resolve cvs.netbsd.org
using getaddrinfo() to resolve cvsup.netbsd.se
using getaddrinfo() to resolve ftp.chg.ru
using getaddrinfo() to resolve ftp.estpak.ee
using getaddrinfo() to resolve ftp.fsn.hu
using getaddrinfo() to resolve ftp.funet.fi
using getaddrinfo() to resolve ftp.netbsd.org
using getaddrinfo() to resolve ftp.nluug.nl
using getaddrinfo() to resolve ftp.plig.net
using getaddrinfo() to resolve ftp.uni-erlangen.de
using getaddrinfo() to resolve ftp.xgate.co.kr
using getaddrinfo() to resolve gd.tuwien.ac.at
using getaddrinfo() to resolve gort.ludd.luth.se
using getaddrinfo() to resolve irc.warped.net
using getaddrinfo() to resolve knug.youn.co.kr
using getaddrinfo() to resolve mail.jp.netbsd.org
using getaddrinfo() to resolve mail.netbsd.org
using getaddrinfo() to resolve melanoma.cs.rmit.edu.au
using getaddrinfo() to resolve mirror.aarnet.edu.au
using getaddrinfo() to resolve moon.vub.ac.be
using getaddrinfo() to resolve net.bsd.cz
using getaddrinfo() to resolve netbsd.3miasto.net
using getaddrinfo() to resolve netbsd.4ka.mipt.ru
using getaddrinfo() to resolve netbsd.csie.nctu.edu.tw
using getaddrinfo() to resolve netbsd.enderunix.org
not equal - one of he->h_addr_list couldn't be found
not ok - addrinfo and hostent are not equal
Comment 5 Ed Maste freebsd_committer freebsd_triage 2023-10-25 13:33:39 UTC
When running just the nss tests in isolation (i.e., kyua test -k /usr/tests/lib/libc/nss/Kyuafile) I observed these two tests failing in one of about 12 runs.

===> Failed tests
gethostby_test:gethostbyname2_getaddrinfo_ipv6  ->  failed: /root/freebsd-src/lib/libc/tests/nss/gethostby_test.c:1148: run_tests(_hostlist_file, ((void *)0), 28, TEST_GETHOSTBYNAME2_GETADDRINFO, 0) == 0 not met  [0.028s]
gethostby_test:getipnodebyname_getaddrinfo_ipv4  ->  failed: /root/freebsd-src/lib/libc/tests/nss/gethostby_test.c:1340: run_tests(_hostlist_file, ((void *)0), 2, TEST_GETHOSTBYNAME2_GETADDRINFO, 0) == 0 not met  [0.028s]

Running now in a loop.