[Dnsmasq-discuss] [BUG] Broken SIGHUP handling in 2.86, regression from 2.85
Charlie Turner
cturner at igalia.com
Tue Feb 8 09:55:42 UTC 2022
`dnsmasq' has regressed in its handling of SIGHUP between 2.85 and
2.86. The `strace' record shows correct behaviour.
When `dnsmasq' boots, but before serving any `BOOTP=/=DHCP' requests, I
can send as many `SIGHUPs' as I like to have the service reread its
configuration files without restarting it. `strace' looks like this
(for
reference to a later capture),
--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} --
-
│getpid() = 492050
I can repeat this `SIGHUP' as many times as I want, successfully.
When I network boot a machine on the interface `dnsmasq' is listening,
`dnsmasq' enters a syscall. Sending a `SIGHUP' now causes a `SIGABRT',
) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)
│--- SIGHUP {si_signo=SIGHUP, si_code=SI_USER, si_pid=2127, si_uid=0} -
--
│getpid() = 485420
│writev(10, [{iov_base="\1\0\0\0\0\0\0\0\0\0\0\0", iov_len=12}], 1) =
12
│rt_sigreturn({mask=[]}) = -1 EINTR (Interrupted system
call)
│poll([{fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=6,
events=POLLIN}, {fd=7, events=POLLIN}, {
│fd=8, events=POLLIN}, {fd=9, events=POLLIN}], 6, -1) = 1 ([{fd=9,
revents=POLLIN}])
│read(9, "\1\0\0\0\0\0\0\0\0\0\0\0", 12) = 12
│writev(2, [{iov_base="free(): invalid pointer", iov_len=23},
{iov_base="\n", iov_len=1}], 2) = 24
│mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7ff941ac8000
│rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
│rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1], [], 8) = 0
│getpid() = 485420
│gettid() = 485420
│tgkill(485420, 485420, SIGABRT) = 0
│rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
│--- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=485420,
si_uid=65534} ---
│+++ killed by SIGABRT +++
I can see `dnsmasq' is within some syscall, and is not handling the
restart request correctly.
B.R.
Charlie.
More information about the Dnsmasq-discuss
mailing list