Package: libevent-2.1-6
Version: 2.1.8-stable-4

We've been hitting a libevent bug in Debian stable where the lloadd
process would crash, usually when DNS is misconfigured, and tracked it
down to a race in evdns_getaddrinfo[0] since fixed in libevent 2.1.9.

For a while, we've been seeing occasional crashes in our CI environment,
when a core/backtrace has been finally collected, the crash[1] matches
the above linked report:

---- 8< ----
gdb ../servers/lloadd/.libs/lloadd testrun/unknown.16279.core
GNU gdb (Debian 8.2.1-2+b3) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../servers/lloadd/.libs/lloadd...done.
[New LWP 16279]
[New LWP 16283]
[New LWP 16284]
[New LWP 16285]
[New LWP 16286]
[New LWP 16287]
[New LWP 16288]

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/builds/ondra/openldap/obj/servers/lloadd/.libs/lloadd 
-s0 -f /builds/ondra/open'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f27690e5d5b in evdns_getaddrinfo_gotresolve (result=3, type=0 
'\000', count=0, ttl=3493, addresses=0x0, arg=0x7f2758001030) at evdns.c:4414
4414    evdns.c: No such file or directory.
[Current thread is 1 (Thread 0x7f27688c5940 (LWP 16279))]
(gdb) bt
#0  0x00007f27690e5d5b in evdns_getaddrinfo_gotresolve (result=3, type=0 
'\000', count=0, ttl=3493, addresses=0x0, arg=0x7f2758001030) at evdns.c:4414
#1  0x00007f27690e05ad in reply_run_callback (d=0x5595cd874b40, 
user_pointer=<optimized out>) at evdns.c:816
#2  0x00007f27690d483f in event_process_active_single_queue 
(base=base@entry=0x5595cd872ef0, activeq=0x5595cd858880,
    max_to_process=max_to_process@entry=2147483647, endtime=endtime@entry=0x0) 
at event.c:1675
#3  0x00007f27690d5537 in event_process_active (base=0x5595cd872ef0) at 
event.c:1738
#4  event_base_loop (base=base@entry=0x5595cd872ef0, flags=flags@entry=0) at 
event.c:1961
#5  0x00007f27690d57a7 in event_base_dispatch 
(event_base=event_base@entry=0x5595cd872ef0) at event.c:1772
#6  0x00005595cbf9241f in lloadd_daemon (daemon_base=0x5595cd872ef0) at 
../../../servers/lloadd/daemon.c:1307
#7  0x00005595cbf81997 in main (argc=<optimized out>, argv=0x7ffc10c448a8) at 
../../../servers/lloadd/main.c:843
(gdb) p *data
$1 = {evdns_base = 0x0, hints = {ai_flags = -846913520, ai_family = 21909, 
ai_socktype = 1, ai_protocol = 6, ai_addrlen = 0, ai_addr = 0x0,
    ai_canonname = 0x0, ai_next = 0x0}, user_cb = 0x5595cbf82670 
<upstream_name_cb>, user_data = 0x5595cd874500, port = 0, ipv4_request = {r = 
0x0,
    type = 1}, ipv6_request = {r = 0x7f27580012c0, type = 3}, cname_result = 
0x0, pending_result = 0x0, timeout = {ev_evcallback = {evcb_active_next = {
        tqe_next = 0x0, tqe_prev = 0x0}, evcb_flags = 128, evcb_pri = 0 '\000', 
evcb_closure = 0 '\000', evcb_cb_union = {
        evcb_callback = 0x7f27690e5b90 <evdns_getaddrinfo_timeout_cb>, 
evcb_selfcb = 0x7f27690e5b90 <evdns_getaddrinfo_timeout_cb>,
        evcb_evfinalize = 0x7f27690e5b90 <evdns_getaddrinfo_timeout_cb>, 
evcb_cbfinalize = 0x7f27690e5b90 <evdns_getaddrinfo_timeout_cb>},
      evcb_arg = 0x7f2758000fd0}, ev_timeout_pos = {ev_next_with_common_timeout 
= {tqe_next = 0xffffffff, tqe_prev = 0x0}, min_heap_idx = -1}, ev_fd = -1,
    ev_base = 0x5595cd872ef0, ev_ = {ev_io = {ev_io_next = {le_next = 0x0, 
le_prev = 0x0}, ev_timeout = {tv_sec = 0, tv_usec = 0}}, ev_signal = {
        ev_signal_next = {le_next = 0x0, le_prev = 0x0}, ev_ncalls = 0, 
ev_pncalls = 0x0}}, ev_events = 0, ev_res = 0, ev_timeout = {tv_sec = 0,
      tv_usec = 0}}, pending_error = 0, user_canceled = 0, request_done = 1}
---- 8< ----

This matches the report in libevent#673[0] and we would appreciate if
the upstream patch were included in the next point release of buster.

Thanks,
Ondrej

[0]. https://github.com/libevent/libevent/pull/673
[1]. https://git.openldap.org/ondra/openldap/-/jobs/6407

Reply via email to