Bug 36730 - dhcpcd: Ошибка сегментирования при получении сигнала SIGUSR1
Summary: dhcpcd: Ошибка сегментирования при получении сигнала SIGUSR1
Status: CLOSED FIXED
Alias: None
Product: Branch p8
Classification: Distributions
Component: dhcpcd (show other bugs)
Version: не указана
Hardware: all Linux
: P3 normal
Assignee: Mikhail Efremov
QA Contact: qa-p8@altlinux.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-08 11:49 MSK by Alexey Melyashinsky
Modified: 2019-05-15 11:25 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Melyashinsky 2019-05-08 11:49:50 MSK
Шаги для воспроизведения:

В первой консоли выполнить команду: 
# dhcpcd -N eth0 --nobackground
sending signal USR1 to pid 6266
eth0: rebinding lease of 10.88.9.122
eth0: leased 10.88.9.122 for 24379 seconds
eth0: changing route to 10.88.8.0/21
eth0: changing default route via 10.88.8.1

Затем, во второй консоли выполнить команду:
# dhcpcd -N eth0 
sending signal USR1 to pid 6291

Результат:
Вывод в консоли, где запущена первая команда:
received SIGUSR1, renewing
Ошибка сегментирования

Примечание:
Воспроизводится в Р8 (dhcpcd-6.11.5.alt1). В Сизифе не воспроизводится (dhcpcd-7.2.1-alt1).

Дополнительная информация. Отладка в GDB:
[root@work-8-2-x86-64-default ~]# gdb dhcpcd
GNU gdb (GDB) 7.9-alt3 (ALT Linux)
Copyright (C) 2015 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-alt-linux".
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 dhcpcd...Reading symbols from /usr/lib/debug/sbin/dhcpcd.debug...done.
done.
(gdb) run -N eth0 --nobackground
Starting program: /sbin/dhcpcd -N eth0 --nobackground
sending signal USR1 to pid 2495
Detaching after fork from child process 2652.
Detaching after fork from child process 2653.
eth0: rebinding lease of 10.88.9.24
eth0: leased 10.88.9.24 for 24551 seconds
eth0: changing route to 10.88.8.0/21
eth0: adding default route via 10.88.8.1
Detaching after fork from child process 2654.

Program received signal SIGUSR1, User defined signal 1.
0x00007ffff7b1e550 in __GI_epoll_pwait (epfd=3, events=events@entry=0x7fffffffe0d0, 
    maxevents=maxevents@entry=1, timeout=12274970, set=set@entry=0x7fffffffe230)
    at ../sysdeps/unix/sysv/linux/epoll_pwait.c:42
42	  return SYSCALL_CANCEL (epoll_pwait, epfd, events, maxevents,
(gdb) c
Continuing.
received SIGUSR1, renewing

Program received signal SIGSEGV, Segmentation fault.
0x0000000000406177 in dhcpcd_ifrenew (ifp=0x659080) at dhcpcd.c:1187
1187		if (ifp->options->options & DHCPCD_LINK &&
(gdb) bt
#0  0x0000000000406177 in dhcpcd_ifrenew (ifp=0x659080) at dhcpcd.c:1187
#1  dhcpcd_renew (ctx=<optimized out>) at dhcpcd.c:1203
#2  0x0000000000408e01 in eloop_start (eloop=0x658a90, signals=signals@entry=0x7fffffffe230)
    at eloop.c:866
#3  0x000000000040395e in main (argc=<optimized out>, argv=<optimized out>) at dhcpcd.c:1940
(gdb) l
1182	static void
1183	dhcpcd_ifrenew(struct interface *ifp)
1184	{
1185	
1186	#define DHCPCD_RARENEW (DHCPCD_IPV6 | DHCPCD_IPV6RS)
1187		if (ifp->options->options & DHCPCD_LINK &&
1188		    ifp->carrier != LINK_DOWN)
1189		{
1190			dhcp_renew(ifp);
1191			if ((ifp->options->options & DHCPCD_RARENEW) == DHCPCD_RARENEW)
(gdb) print ifp
$1 = (struct interface *) 0x659080
(gdb) print ifp->options
$2 = (struct if_options *) 0x0
(gdb) print *ifp
$3 = {ctx = 0x7fffffffe150, next = {tqe_next = 0x0, tqe_prev = 0x658f68}, 
  name = "lo", '\000' <repeats 13 times>, index = 1, active = 0, flags = 65609, family = 772, 
  hwaddr = '\000' <repeats 19 times>, hwlen = 6 '\006', metric = 201, carrier = 0, wireless = 0, 
  ssid = '\000' <repeats 32 times>, ssid_len = 0, profile = '\000' <repeats 63 times>, options = 0x0, 
  if_data = {0x660e80, 0x0, 0x0, 0x0, 0x659290, 0x0, 0x0}}
(gdb)
Comment 1 Alexey Melyashinsky 2019-05-15 11:25:45 MSK
Bug fixed in #229367.