dispatch_test fails in connected_shutdown() on FreeBSD
Looks like we always expect the connect to succeed, but sometimes that's not the case on FreeBSD:
Thread 1 (LWP 100118):
#0 0x000000083165286a in thr_kill () from /lib/libc.so.7
No symbol table info available.
#1 0x00000008315caf54 in raise () from /lib/libc.so.7
No symbol table info available.
#2 0x000000083167bfc9 in abort () from /lib/libc.so.7
No symbol table info available.
#3 0x000000082ccfdcac in ?? () from /usr/local/lib/libcmocka.so.0
No symbol table info available.
#4 0x000000082ccff507 in _fail () from /usr/local/lib/libcmocka.so.0
No symbol table info available.
#5 0x000000082ccff569 in mock_assert () from /usr/local/lib/libcmocka.so.0
No symbol table info available.
#6 0x0000000000206292 in connected_shutdown (eresult=<optimized out>, region=<optimized out>, arg=<optimized out>) at dispatch_test.c:480
test = <optimized out>
#7 0x0000000822addee6 in resp_connected (arg=0x1ee88d29e780) at dispatch.c:1784
resp = 0x1ee88d29e780
#8 tcp_connected (handle=0x1ee88d291500, eresult=<optimized out>, arg=0x1ee88d291420) at dispatch.c:1858
disp = 0x1ee88d291420
resp = 0x1ee88d29e780
next = 0x0
resps = {head = 0x0, tail = 0x0}
#9 0x0000000821b8717a in streamdns_call_connect_cb (sock=0x1ee88d2ff400, handle=0x1ee88d291500, result=ISC_R_CONNECTIONRESET) at netmgr/streamdns.c:292
No locals.
#10 streamdns_transport_connected (handle=<optimized out>, result=ISC_R_CONNECTIONRESET, cbarg=<optimized out>) at netmgr/streamdns.c:381
sock = 0x1ee88d2ff400
streamhandle = 0x1ee88d291500
#11 0x0000000821b7d0be in isc___nm_connectcb (arg=<optimized out>) at netmgr/netmgr.c:1830
uvreq = <optimized out>
#12 isc__nm_connectcb (sock=sock@entry=0x1ee88d2ff900, uvreq=uvreq@entry=0x1ee88d2dea00, eresult=ISC_R_NOPERM, eresult@entry=ISC_R_CONNECTIONRESET, async=false) at netmgr/netmgr.c:1845
No locals.
#13 0x0000000821b7ce97 in isc__nm_failed_connect_cb (sock=sock@entry=0x1ee88d2ff900, req=req@entry=0x1ee88d2dea00, eresult=ISC_R_CONNECTIONRESET, async=false) at netmgr/netmgr.c:1040
No locals.
#14 0x0000000821b8bc45 in tcp_connect_cb (uvreq=<optimized out>, status=-54) at netmgr/tcp.c:215
ss = {ss_len = 84 'T', ss_family = 155 '\233', __ss_pad1 = "\270!\b\000\000", __ss_align = 34909608672, __ss_pad2 = "\365\342f1\b\000\000\000\t\030<\226\000\000\000\000\004\000\000\000\350\036\000\000\374Z\306 \b\000\000\000\200\347-\215\350\036\000\000\260Z\306 \b\000\000\000;\225\270!\b\000\000\000\000\r0\215\350\036\000\000\000\345/\215\350\036\000\000\000\000\000\000\000\000\000\000\200\0170\215\350\036\000\000\000\r0\215\350\036\000\000\200\030)\215\350\036\000\000FCl\362_~\222K"}
result = ISC_R_SUCCESS
req = 0x1ee88d2dea00
sock = 0x1ee88d2ff900
worker = 0x1ee88d2106e0
r = <optimized out>
#15 0x000000082426e2b5 in ?? () from /usr/local/lib/libuv.so.1
No symbol table info available.
#16 0x0000000824274dcb in ?? () from /usr/local/lib/libuv.so.1
No symbol table info available.
#17 0x0000000824263a80 in uv_run () from /usr/local/lib/libuv.so.1
No symbol table info available.
#18 0x0000000821ba576d in loop_thread (arg=arg@entry=0x1ee88d212700) at loop.c:288
loop = 0x1ee88d212700
r = 0
ret = <optimized out>
#19 0x0000000821bb6214 in thread_body (wrap=0x1ee88d2503c0) at thread.c:85
jemalloc_enforce_init = 0x1ee88d249508
func = 0x821ba56c0 <loop_thread>
ret = 0x0
arg = 0x1ee88d212700
#20 isc_thread_main (func=0x821ba56c0 <loop_thread>, arg=0x1ee88d212700) at thread.c:116
No locals.
#21 0x0000000821ba5613 in isc_loopmgr_run (loopmgr=0x1ee88d23c980) at loop.c:462
No locals.
#22 0x0000000000205a74 in run_test_dispatch_newtcp (state=<optimized out>) at dispatch_test.c:815
setup_loop = 0x0
teardown_loop = 0x0
#23 0x000000082cd029dc in ?? () from /usr/local/lib/libcmocka.so.0
No symbol table info available.
#24 0x000000082cd00935 in _cmocka_run_group_tests () from /usr/local/lib/libcmocka.so.0
No symbol table info available.
#25 0x00000000002061ec in main () at dispatch_test.c:861
r = <optimized out>
D:dispatch_test:backtrace from ./core.15280 end
FAIL dispatch_test (exit status: 134)