<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>36730</bug_id>
          
          <creation_ts>2019-05-08 11:49:50 +0300</creation_ts>
          <short_desc>dhcpcd: Ошибка сегментирования при получении сигнала SIGUSR1</short_desc>
          <delta_ts>2019-05-15 11:25:45 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Distributions</classification>
          <product>Branch p8</product>
          <component>dhcpcd</component>
          <version>не указана</version>
          <rep_platform>all</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexey Melyashinsky">bip</reporter>
          <assigned_to name="Mikhail Efremov">sem</assigned_to>
          <cc>bip</cc>
    
    <cc>darktemplaralt</cc>
    
    <cc>sotor</cc>
          
          <qa_contact name="qa-p8@altlinux.org">qa-p8</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>181526</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Melyashinsky">bip</who>
    <bug_when>2019-05-08 11:49:50 +0300</bug_when>
    <thetext>Шаги для воспроизведения:

В первой консоли выполнить команду: 
# 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 &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-alt-linux&quot;.
Type &quot;show configuration&quot; for configuration details.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;.
Find the GDB manual and other documentation resources online at:
&lt;http://www.gnu.org/software/gdb/documentation/&gt;.
For help, type &quot;help&quot;.
Type &quot;apropos word&quot; to search for commands related to &quot;word&quot;...
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-&gt;options-&gt;options &amp; DHCPCD_LINK &amp;&amp;
(gdb) bt
#0  0x0000000000406177 in dhcpcd_ifrenew (ifp=0x659080) at dhcpcd.c:1187
#1  dhcpcd_renew (ctx=&lt;optimized out&gt;) at dhcpcd.c:1203
#2  0x0000000000408e01 in eloop_start (eloop=0x658a90, signals=signals@entry=0x7fffffffe230)
    at eloop.c:866
#3  0x000000000040395e in main (argc=&lt;optimized out&gt;, argv=&lt;optimized out&gt;) 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-&gt;options-&gt;options &amp; DHCPCD_LINK &amp;&amp;
1188		    ifp-&gt;carrier != LINK_DOWN)
1189		{
1190			dhcp_renew(ifp);
1191			if ((ifp-&gt;options-&gt;options &amp; DHCPCD_RARENEW) == DHCPCD_RARENEW)
(gdb) print ifp
$1 = (struct interface *) 0x659080
(gdb) print ifp-&gt;options
$2 = (struct if_options *) 0x0
(gdb) print *ifp
$3 = {ctx = 0x7fffffffe150, next = {tqe_next = 0x0, tqe_prev = 0x658f68}, 
  name = &quot;lo&quot;, &apos;\000&apos; &lt;repeats 13 times&gt;, index = 1, active = 0, flags = 65609, family = 772, 
  hwaddr = &apos;\000&apos; &lt;repeats 19 times&gt;, hwlen = 6 &apos;\006&apos;, metric = 201, carrier = 0, wireless = 0, 
  ssid = &apos;\000&apos; &lt;repeats 32 times&gt;, ssid_len = 0, profile = &apos;\000&apos; &lt;repeats 63 times&gt;, options = 0x0, 
  if_data = {0x660e80, 0x0, 0x0, 0x0, 0x659290, 0x0, 0x0}}
(gdb)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>181637</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Melyashinsky">bip</who>
    <bug_when>2019-05-15 11:25:45 +0300</bug_when>
    <thetext>Bug fixed in #229367.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>