dig crashes after SIGINT if there are multiple queries
Summary
Dig with multiple queries crashes when interrupted.
BIND version used
Steps to reproduce
$ dig 2000.delay.getdnsapi.net 3000.delay.getdnsapi.net
- SIGINT before the first query finishes.
What is the current bug behavior?
signal.c:78: REQUIRE(((signal) != ((void *)0) && ((const isc__magic_t *)(signal))->magic == ((('S') << 24 | ('I') << 16 | ('G') << 8 | (' '))))) failed, back trace
What is the expected correct behavior?
No crash.
Relevant configuration files
None needed.
Relevant logs and/or screenshots
Full debug log:
$ dig -d 2000.delay.getdnsapi.net 3000.delay.getdnsapi.net
setup_libs()
setup_system()
create_search_list()
ndots is 1.
timeout is 0.
retries is 3.
get_server_list()
make_server(127.0.0.111)
dig_query_setup
parse_args()
making new lookup
make_empty_lookup()
make_empty_lookup() = 0x7f6faa9aa000->references = 1
digrc (open)
main parsing +timeout=5
main parsing +retry=0
main parsing -d
main parsing 2000.delay.getdnsapi.net
clone_lookup()
make_empty_lookup()
make_empty_lookup() = 0x7f6faa9ab800->references = 1
clone_server_list()
looking up 2000.delay.getdnsapi.net
main parsing 3000.delay.getdnsapi.net
clone_lookup()
make_empty_lookup()
make_empty_lookup() = 0x7f6faa9ad000->references = 1
clone_server_list()
looking up 3000.delay.getdnsapi.net
dig_startup()
start_lookup()
setup_lookup(0x7f6faa9ab800)
resetting lookup counter.
cloning server list
clone_server_list()
make_server(127.0.0.111)
idn_textname: 2000.delay.getdnsapi.net
using root origin
recursive query
AD query
add_question()
starting to render the message
add_opt()
done rendering
create query 0x7f6fab09f540 linked to lookup 0x7f6faa9ab800
dighost.c:2141:lookup_attach(0x7f6faa9ab800) = 2
dighost.c:2652:new_query(0x7f6fab09f540) = 1
do_lookup()
start_udp(0x7f6fab09f540)
dighost.c:3255:query_attach(0x7f6fab09f540) = 2
working on lookup 0x7f6faa9ab800, query 0x7f6fab09f540
dighost.c:3300:query_attach(0x7f6fab09f540) = 3
udp_ready()
udp_ready(0x7f6fab09f700, success, 0x7f6fab09f540)
dighost.c:3147:lookup_attach(0x7f6faa9ab800) = 3
dighost.c:3216:query_attach(0x7f6fab09f540) = 4
recving with lookup=0x7f6faa9ab800, query=0x7f6fab09f540, handle=0x7f6fab09f700
recvcount=1
have local timeout of 5000
dighost.c:3094:query_attach(0x7f6fab09f540) = 5
sending a request
sendcount=1
dighost.c:1729:query_detach(0x7f6fab09f540) = 4
dighost.c:3236:query_detach(0x7f6fab09f540) = 3
dighost.c:3237:lookup_detach(0x7f6faa9ab800) = 2
send_done(0x7f6fab09f700, success, 0x7f6fab09f540)
sendcount=0
dighost.c:2729:lookup_attach(0x7f6faa9ab800) = 3
dighost.c:2746:query_detach(0x7f6fab09f540) = 2
dighost.c:2747:lookup_detach(0x7f6faa9ab800) = 2
check_if_done()
list full
pending lookup 0x7f6faa9ad000
^Crecv_done(0x7f6fab09f700, shutting down, 0x7ffe1fb53710, 0x7f6fab09f540)
recvcount=0
dighost.c:3905:lookup_attach(0x7f6faa9ab800) = 3
recv_done: cancel
dighost.c:3913:_cancel_lookup()
canceling pending query 0x7f6fab09f540, belonging to 0x7f6faa9ab800
dighost.c:2775:query_detach(0x7f6fab09f540) = 1
check_if_done()
list full
pending lookup 0x7f6faa9ad000
dighost.c:3915:query_detach(0x7f6fab09f540) = 0
dighost.c:3915:destroy_query(0x7f6fab09f540) = 0
dighost.c:1687:lookup_detach(0x7f6faa9ab800) = 2
dighost.c:3916:lookup_detach(0x7f6faa9ab800) = 1
clear_current_lookup()
lookup cleared
dighost.c:1820:lookup_detach(0x7f6faa9ab800) = 0
destroy_lookup
freeing server 0x7f6fab072a00 belonging to 0x7f6faa9ab800
start_lookup()
setup_lookup(0x7f6faa9ad000)
resetting lookup counter.
cloning server list
clone_server_list()
make_server(127.0.0.111)
idn_textname: 3000.delay.getdnsapi.net
using root origin
recursive query
AD query
add_question()
starting to render the message
add_opt()
done rendering
create query 0x7f6fab09f540 linked to lookup 0x7f6faa9ad000
dighost.c:2141:lookup_attach(0x7f6faa9ad000) = 2
dighost.c:2652:new_query(0x7f6fab09f540) = 1
do_lookup()
start_udp(0x7f6fab09f540)
dighost.c:3255:query_attach(0x7f6fab09f540) = 2
working on lookup 0x7f6faa9ad000, query 0x7f6fab09f540
signal.c:78: REQUIRE(((signal) != ((void *)0) && ((const isc__magic_t *)(signal))->magic == ((('S') << 24 | ('I') << 16 | ('G') << 8 | (' '))))) failed, back trace
/usr/lib/libisc-9.19.19-dev.so(+0x33891)[0x7f6faef42891]
/usr/lib/libisc-9.19.19-dev.so(isc_assertion_failed+0x31)[0x7f6faef427a2]
/usr/lib/libisc-9.19.19-dev.so(isc_signal_stop+0x44)[0x7f6faef71f5b]
/usr/lib/libisc-9.19.19-dev.so(isc_loopmgr_blocking+0x55)[0x7f6faef61f96]
dig(get_address+0x38)[0x55ddd5ed030b]
dig(+0x1b006)[0x55ddd5ecc006]
dig(do_lookup+0xc8)[0x55ddd5ed067b]
dig(start_lookup+0x285)[0x55ddd5ec6e71]
dig(+0x15485)[0x55ddd5ec6485]
dig(+0x15fcc)[0x55ddd5ec6fcc]
dig(+0x1d23b)[0x55ddd5ece23b]
/usr/lib/libisc-9.19.19-dev.so(+0x1e71d)[0x7f6faef2d71d]
/usr/lib/libisc-9.19.19-dev.so(isc__nm_readcb+0x121)[0x7f6faef2d863]
/usr/lib/libisc-9.19.19-dev.so(isc__nm_udp_failed_read_cb+0x12b)[0x7f6faef420b0]
/usr/lib/libisc-9.19.19-dev.so(isc__nm_failed_read_cb+0x89)[0x7f6faef2ac2c]
/usr/lib/libisc-9.19.19-dev.so(isc__nm_udp_shutdown+0x127)[0x7f6faef42723]
/usr/lib/libisc-9.19.19-dev.so(isc__nmsocket_shutdown+0x6e)[0x7f6faef2dd24]
/usr/lib/libisc-9.19.19-dev.so(+0x1edb4)[0x7f6faef2ddb4]
/usr/lib/libuv.so.1(uv_walk+0x9b)[0x7f6fae9a474b]
/usr/lib/libisc-9.19.19-dev.so(+0x1818b)[0x7f6faef2718b]
/usr/lib/libisc-9.19.19-dev.so(isc__async_cb+0x18d)[0x7f6faef42c6b]
/usr/lib/libuv.so.1(+0x9a1b)[0x7f6fae99fa1b]
/usr/lib/libuv.so.1(+0x26d48)[0x7f6fae9bcd48]
/usr/lib/libuv.so.1(uv_run+0x1bf)[0x7f6fae9a4fbf]
/usr/lib/libisc-9.19.19-dev.so(+0x51370)[0x7f6faef60370]
/usr/lib/libisc-9.19.19-dev.so(+0x66f07)[0x7f6faef75f07]
/usr/lib/libisc-9.19.19-dev.so(isc_thread_main+0x62)[0x7f6faef75fc6]
/usr/lib/libisc-9.19.19-dev.so(isc_loopmgr_run+0x187)[0x7f6faef613fb]
dig(dig_startup+0x48)[0x55ddd5ec0624]
dig(main+0x40)[0x55ddd5ec068a]
/usr/lib/libc.so.6(+0x27cd0)[0x7f6fae9f1cd0]
/usr/lib/libc.so.6(__libc_start_main+0x8a)[0x7f6fae9f1d8a]
dig(_start+0x25)[0x55ddd5eb7045]
Aborted (core dumped)
Edited by Mark Andrews