Re: v8 to v9.3.3 segmentation fault on linux
[anp/hsw]
Mon Nov 23 13:07:34 2020
> So dhcpcd-9 builds with privilege separation.
> This requires a user to be added to your system otherwise it will be disabled.
> Also, /var/db doesn't exist. dhcpcd cannot create that for you.
> Either create it or adjust your configure to a different location and recompile.
>
Yes, i know it, it's test run and this will be fixed on production
build.
> This is the second part of the problem.
> Your kernel headers are vastly newer than the kernel.
> IFA_F_NOPREFIXROUTE was first defined in Linux-3.13 but your running kernel is
> Linux-3.2
> Essentially using newer headers advertises features which are not available, and
> this is what you are seeing.
>
I found only headers for kernel 3.2.101 and 3.4.110 (which i think
defines it), so i must specify exact version of kernel headers? Is
passing -I to compiler enough?
I tried passing -UIFA_F_NOPREFIXROUTE at compile time with no success.
> Irregardless of the above, dhcpcd should still not crash.
> A backtrace here would be helpful.
Here is backtrace:
(gdb) run
Starting program: /tmp/dhcpcd -nBpEAKLGdd -h system -t 0 -l 3600
-c /etc/dhcpcd/dynamic-eth0.1446 eth0.1446
read_config: /etc/dhcpcd.conf: No such file or directory
sending signal HUP to pid 16925
no such user dhcpcd
dhcpcd-9.3.3 starting
DUID 00:04:49:43:4d:53:02:00:90:13:25:00:13:90:25:00:c4:84
read_config: /etc/dhcpcd.conf: No such file or directory
eth0.1446: executing: /etc/dhcpcd/dynamic-eth0.1446 PREINIT
eth0.1446: IAID ff:00:05:a6
eth0.1446: delaying IPv6 router solicitation for 0.2 seconds
eth0.1446: delaying IPv4 for 1.9 seconds
eth0.1446: soliciting an IPv6 router
eth0.1446: sending Router Solicitation
eth0.1446: using hwaddr 00:a0:d1:cf:de:34
eth0.1446: reading lease: /var/db/dhcpcd/eth0.1446.lease
eth0.1446: soliciting a DHCP lease
eth0.1446: sending DISCOVER (xid 0x75daafb0), next in 3.2 seconds
eth0.1446: offered 192.168.168.51 from 80.89.133.227
eth0.1446: sending REQUEST (xid 0x75daafb0), next in 4.5 seconds
eth0.1446: acknowledged 192.168.168.51 from 80.89.133.227
eth0.1446: leased 192.168.168.51 for 3600 seconds
eth0.1446: renew in 1800 seconds, rebind in 3150 seconds
eth0.1446: writing lease: /var/db/dhcpcd/eth0.1446.lease
eth0.1446: adding IP address 192.168.168.51/24 broadcast 192.168.168.255
ipv4_addaddr: if_addaddress: Invalid argument
Program received signal SIGSEGV, Segmentation fault.
0x8002ef75 in dhcp_openudp (ia=0x8) at dhcp.c:1604
1604 sin.sin_addr = *ia;
(gdb) bt
#0 0x8002ef75 in dhcp_openudp (ia=0x8) at dhcp.c:1604
#1 0x800311dc in dhcp_bind (ifp=0x80097598) at dhcp.c:2391
#2 0x80031549 in dhcp_arp_bind (ifp=0x80097598) at dhcp.c:2498
#3 0x80033f1e in dhcp_handledhcp (ifp=0x80097598, bootp=0xbfffd1ba,
bootp_len=300, from=0xbfffd128) at dhcp.c:3402
#4 0x800343d1 in dhcp_handlebootp (ifp=0x80097598, bootp=0xbfffd1ba,
len=300, from=0xbfffd128) at dhcp.c:3543
#5 0x8003456e in dhcp_packet (ifp=0x80097598, data=0xbfffd19e "E",
len=328, bpf_flags=1) at dhcp.c:3613
#6 0x800346b4 in dhcp_readbpf (arg=0x80097598) at dhcp.c:3635
#7 0x80012630 in eloop_start (eloop=0x8008db78, signals=0xbffffa60) at
eloop.c:757
#8 0x8001035b in main (argc=11, argv=0xbffffcd4, envp=0xbffffd04) at
dhcpcd.c:2515
(gdb) bt full
#0 0x8002ef75 in dhcp_openudp (ia=0x8) at dhcp.c:1604
s = 16
sin = {sin_family = 2, sin_port = 17408, sin_addr = {s_addr =
0}, sin_zero = "\000\000\000\000\000\000\000"}
n = 1
#1 0x800311dc in dhcp_bind (ifp=0x80097598) at dhcp.c:2391
ctx = 0xbffff894
state = 0x800abee8
ifo = 0x800979d0
lease = 0x800abf0c
old_state = 0 '\000'
__func__ = "dhcp_bind"
#2 0x80031549 in dhcp_arp_bind (ifp=0x80097598) at dhcp.c:2498
No locals.
#3 0x80033f1e in dhcp_handledhcp (ifp=0x80097598, bootp=0xbfffd1ba,
bootp_len=300, from=0xbfffd128) at dhcp.c:3402
state = 0x800abee8
ifo = 0x800979d0
lease = 0x800abf0c
type = 5 '\005'
tmp = 36 '$'
addr = {s_addr = 3221213372}
i = 255
msg = 0xbfffd078 "╫$"
bootp_copied = false
v6only_time = 0
use_v6only = false
auth = 0x0
auth_len = 0
__func__ = "dhcp_handledhcp"
#4 0x800343d1 in dhcp_handlebootp (ifp=0x80097598, bootp=0xbfffd1ba,
len=300, from=0xbfffd128) at dhcp.c:3543
v = 64
#5 0x8003456e in dhcp_packet (ifp=0x80097598, data=0xbfffd19e "E",
len=328, bpf_flags=1) at dhcp.c:3613
bootp = 0xbfffd1ba
from = {s_addr = 21363550}
udp_len = 300
fl = 14
state = 0x800abee8
__func__ = "dhcp_packet"
#6 0x800346b4 in dhcp_readbpf (arg=0x80097598) at dhcp.c:3635
ifp = 0x80097598
buf = "E\000\001H\023\000\000Ъ\021^Н^ШE\001^ШE3\000C\000D\001
\064\000\000\002\001\006\001uз╞╟\000\001\000\000\000\000\000\000^ШE3\000
\000\000\000^ШE\001\000═яоч4", '\000' <repeats 202 times>...
bytes = 342
state = 0x800abee8
bpf = 0x800ac5e8
__func__ = "dhcp_readbpf"
#7 0x80012630 in eloop_start (eloop=0x8008db78, signals=0xbffffa60) at
eloop.c:757
n = 1
e = 0x800acc20
t = 0x800931c0
ts = {tv_sec = 1, tv_nsec = 264529410}
tsp = 0xbffff5f4
__PRETTY_FUNCTION__ = "eloop_start"
#8 0x8001035b in main (argc=11, argv=0xbffffcd4, envp=0xbffffd04) at
dhcpcd.c:2515
ctx = {pidfile = "/var/run/dhcpcd/eth0.1446.pid", '\000'
<repeats 13 times>, vendor =
"dhcpcd-9.3.3:Linux-3.2.88-880ru-0001:i686:GenuineIntel", '\000'
<repeats 201 times>,
stdin_valid = true, stdout_valid = true, stderr_valid = true,
stderr_fd = 0, fork_fd = -1, cffile = 0x8006198b "/etc/dhcpcd.conf",
options = 310326632156237984, logfile = 0x0,
argc = 11, argv = 0xbffffcd4, ifac = 0, ifav = 0x0, ifdc = 0,
ifdv = 0x0, ifc = 1, ifv = 0xbffffcfc, ifcc = 0, ifcv = 0x0, duid_type =
0 '\000', duid = 0x80093138 "",
duid_len = 18, ifaces = 0x80093208, ctl_buf = 0x0, ctl_buflen
= 0, ctl_bufpos = 0, ctl_extra = 0, routes = {rbt_root = 0x0, rbt_ops =
0x80075a70 <rt_compare_os_ops>,
rbt_minmax = {0x0, 0x0}}, froutes = {rbt_root = 0x0, rbt_ops
= 0x80075aa0 <rt_compare_free_ops>, rbt_minmax = {0x0, 0x0}}, rt_order =
0, pf_inet_fd = 11, priv = 0x800930c0,
link_fd = 8, link_rcvbuf = 0, seq = 101, sseq = 0, sigset =
{__val = {0 <repeats 32 times>}}, eloop = 0x8008db78, script =
0x800ad870 "/etc/dhcpcd/dynamic-eth0.1446",
script_fp = 0x800a9c78, script_buf = 0x800a9de8
"PATH=/usr/bin:/bin:/usr/sbin:/sbin", script_buflen = 912, script_env =
0x800abdf0, script_envlen = 15, control_fd = 5,
---Type <return> to continue, or q <return> to quit---
control_unpriv_fd = 6, control_fds = {tqh_first = 0x0,
tqh_last = 0xbffffb04}, control_sock =
"/var/run/dhcpcd/eth0.1446.unpriv.sock\000\000\000\000\000\000\000",
control_sock_unpriv = '\000' <repeats 51 times>, control_group
= 0, vivso = 0x0, vivso_len = 0, randomstate = 0x0, ps_user = 0x0,
ps_root_pid = 0, ps_root_fd = -1,
ps_log_fd = -1, ps_data_fd = -1, ps_eloop = 0x0, ps_processes
= {tqh_first = 0x0, tqh_last = 0xbffffb98}, ps_inet_pid = 0, ps_inet_fd
= -1, ps_control_pid = 0,
ps_control_fd = -1, ps_control_data_fd = 0, ps_control = 0x0,
ps_control_client = 0x0, dhcp_opts = 0x8008bfb0, dhcp_opts_len = 125,
udp_rfd = -1, udp_wfd = 15, opt_buffer = 0x0,
opt_buffer_len = 0, secret = 0x0, secret_len = 0, nd_fd = 14,
ra_routers = 0x800930f8, nd_opts = 0x8008d530, nd_opts_len = 7,
dhcp6_rfd = -1, dhcp6_wfd = -1,
dhcp6_opts = 0x80091428, dhcp6_opts_len = 79, dev_load = 0x0,
dev_fd = -1, dev = 0x0, dev_handle = 0x0}
ifaddrs = 0x0
ifo = 0x0
ifp = 0x0
family = 0
opt = 1
oi = 0
i = 1
logopts = 2136064
t = 0
len = -1073743064
pid = 0
fork_fd = {-1208437696, -1073743496}
stderr_fd = {-1208066645, 1}
sig = 1
siga = 0x800619a1 "HUP"
si = 1
__func__ = "main"
(gdb)
Archive administrator: postmaster@marples.name