Closed mdtancsa closed 5 years ago
compiling with debug flags,
Program received signal SIGSEGV, Segmentation fault.
0x000000000040ec84 in connected_up (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:212
212 PREFIX_COPY(&p, CONNECTED_PREFIX(ifc));
Current language: auto; currently minimal
(gdb) where
#0 0x000000000040ec84 in connected_up (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:212
#1 0x000000000041035c in connected_announce (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:92
#2 0x000000000040f51a in connected_update (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:197
#3 0x000000000040fd69 in connected_add_ipv6 (ifp=0x8022e4a00, flags=2, addr=0x7fffffffe830, prefixlen=64 '@', label=0x0) at zebra/connected.c:526
#4 0x000000000041c660 in ifam_read (ifam=0x8022d4190) at zebra/kernel_socket.c:773
#5 0x000000000041189f in interface_list (zns=0x8022552a0) at zebra/if_sysctl.c:126
#6 0x00000000004340cb in zebra_ns_enable (ns_id=0, info=0x69d228) at zebra/zebra_ns.c:55
#7 0x0000000000434174 in zebra_ns_init () at zebra/zebra_ns.c:84
#8 0x00000000004205e1 in main (argc=1, argv=0x7fffffffeaa0) at zebra/main.c:307
(gdb) list
307 zebra_ns_init();
308
309 zebra_vty_init();
310 access_list_init();
311 prefix_list_init();
312 #if defined(HAVE_RTADV)
313 rtadv_cmd_init();
314 #endif
315 /* PTM socket */
316 #ifdef ZEBRA_PTM_SUPPORT
(gdb) up 0
#0 0x000000000040ec84 in connected_up (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:212
212 PREFIX_COPY(&p, CONNECTED_PREFIX(ifc));
(gdb) list
207 };
208
209 if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL))
210 return;
211
212 PREFIX_COPY(&p, CONNECTED_PREFIX(ifc));
213
214 /* Apply mask to the network. */
215 apply_mask(&p);
216
(gdb) bt full
#0 0x000000000040ec84 in connected_up (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:212
afi = 0
p = {family = 40 '(', prefixlen = 0 '\0', u = {prefix = 0 '\0', prefix4 = {s_addr = 0}, prefix6 = {__u6_addr = {__u6_addr8 = 0x7fffffffe618 "", __u6_addr16 = 0x7fffffffe618,
__u6_addr32 = 0x7fffffffe618}}, lp = {id = {s_addr = 0}, adv_router = {s_addr = 0}}, prefix_eth = {octet = 0x7fffffffe618 ""}, val = 0x7fffffffe618 "", ptr = 0, prefix_evpn = {
route_type = 0 '\0', ip_prefix_length = 0 '\0', mac = {octet = 0x7fffffffe61a ""}, eth_tag = 36424832, ip = {ipa_type = 8, ip = {addr = 0 '\0', _v4_addr = {s_addr = 36588032},
_v6_addr = {__u6_addr = {__u6_addr8 = 0x7fffffffe628 "", __u6_addr16 = 0x7fffffffe628, __u6_addr32 = 0x7fffffffe628}}}}}}}
nh = {next = 0x0, prev = 0x0, ifindex = 13, type = NEXTHOP_TYPE_IFINDEX, flags = 0 '\0', {gate = {ipv4 = {s_addr = 0}, ipv6 = {__u6_addr = {__u6_addr8 = 0x7fffffffe524 "",
__u6_addr16 = 0x7fffffffe524, __u6_addr32 = 0x7fffffffe524}}}, bh_type = BLACKHOLE_UNSPEC}, src = {ipv4 = {s_addr = 0}, ipv6 = {__u6_addr = {__u6_addr8 = 0x7fffffffe534 "",
__u6_addr16 = 0x7fffffffe534, __u6_addr32 = 0x7fffffffe534}}}, rmap_src = {ipv4 = {s_addr = 0}, ipv6 = {__u6_addr = {__u6_addr8 = 0x7fffffffe544 "",
__u6_addr16 = 0x7fffffffe544, __u6_addr32 = 0x7fffffffe544}}}, resolved = 0x0, rparent = 0x0, nh_label_type = ZEBRA_LSP_NONE, nh_label = 0x0}
#1 0x000000000041035c in connected_announce (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:92
No locals.
#2 0x000000000040f51a in connected_update (ifp=0x8022e4a00, ifc=0x8022bcc80) at zebra/connected.c:197
current = (struct connected *) 0x0
#3 0x000000000040fd69 in connected_add_ipv6 (ifp=0x8022e4a00, flags=2, addr=0x7fffffffe830, prefixlen=64 '@', label=0x0) at zebra/connected.c:526
p = (struct prefix_ipv6 *) 0x8022bccb0
ifc = (struct connected *) 0x8022bcc80
#4 0x000000000041c660 in ifam_read (ifam=0x8022d4190) at zebra/kernel_socket.c:773
ifp = (struct interface *) 0x8022e4a00
addr = {sa = {sa_len = 28 '\034', sa_family = 28 '\034', sa_data = 0x7fffffffe82a ""}, sin = {sin_len = 28 '\034', sin_family = 28 '\034', sin_port = 0, sin_addr = {s_addr = 0},
sin_zero = 0x7fffffffe830 "þ\200"}, sin6 = {sin6_len = 28 '\034', sin6_family = 28 '\034', sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__u6_addr = {
__u6_addr8 = 0x7fffffffe830 "þ\200", __u6_addr16 = 0x7fffffffe830, __u6_addr32 = 0x7fffffffe830}}, sin6_scope_id = 13}}
mask = {sa = {sa_len = 28 '\034', sa_family = 28 '\034', sa_data = 0x7fffffffe80a ""}, sin = {sin_len = 28 '\034', sin_family = 28 '\034', sin_port = 0, sin_addr = {s_addr = 0},
sin_zero = 0x7fffffffe810 "ÿÿÿÿÿÿÿÿ"}, sin6 = {sin6_len = 28 '\034', sin6_family = 28 '\034', sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__u6_addr = {
__u6_addr8 = 0x7fffffffe810 "ÿÿÿÿÿÿÿÿ", __u6_addr16 = 0x7fffffffe810, __u6_addr32 = 0x7fffffffe810}}, sin6_scope_id = 0}}
brd = {sa = {sa_len = 0 '\0', sa_family = 0 '\0', sa_data = 0x7fffffffe7ea ""}, sin = {sin_len = 0 '\0', sin_family = 0 '\0', sin_port = 0, sin_addr = {s_addr = 0},
sin_zero = 0x7fffffffe7f0 ""}, sin6 = {sin6_len = 0 '\0', sin6_family = 0 '\0', sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__u6_addr = {__u6_addr8 = 0x7fffffffe7f0 "",
__u6_addr16 = 0x7fffffffe7f0, __u6_addr32 = 0x7fffffffe7f0}}, sin6_scope_id = 0}}
ifname = 0x7fffffffe860 ""
ifnlen = 0
isalias = 0 '\0'
flags = 2
#5 0x000000000041189f in interface_list (zns=0x8022552a0) at zebra/if_sysctl.c:126
ref = 0x8022d3000 "à"
buf = 0x8022d4190 "`"
end = 0x8022d4238 ""
bufsiz = 4664
ifm = (struct if_msghdr *) 0x8022d4190
---Type <return> to continue, or q <return> to quit---
mib = 0x7fffffffe8c0
#6 0x00000000004340cb in zebra_ns_enable (ns_id=0, info=0x69d228) at zebra/zebra_ns.c:55
zns = (struct zebra_ns *) 0x8022552a0
#7 0x0000000000434174 in zebra_ns_init () at zebra/zebra_ns.c:84
No locals.
#8 0x00000000004205e1 in main (argc=1, argv=0x7fffffffeaa0) at zebra/main.c:307
zserv_path = 0x0
lblmgr_path = 0x0
dummy = {ss_len = 0 '\0', ss_family = 0 '\0', __ss_pad1 = 0x7fffffffe9ca "", __ss_align = 1, __ss_pad2 = 0x7fffffffe9d8 "°êÿÿÿ\177"}
dummylen = 32767
cat /var/tmp/quagga.zebra.crashlog
ZEBRA: Received signal 11 at 1527787680 (si_addr 0x20); aborting...
Backtrace for 5 stack frames:
0x8009075d4 <zlog_backtrace_sigsafe+0x44> at /usr/local/lib/libfrr.so.0
0x800906af6 <zlog_signal+0x496> at /usr/local/lib/libfrr.so.0
0x800927ed1 <signal_init+0x3b1> at /usr/local/lib/libfrr.so.0
0x8015f2954 <pthread_sigmask+0x544> at /lib/libthr.so.3
0x8015f1eb2 <pthread_getspecific+0xe12> at /lib/libthr.so.3
no thread information available
@mdtancsa Are you able to reproduce it with FRR 5.0 ? I didn't see this problem with my work-in-progress FRR 5.0 port, and because I didn't see any mention of this bug in the release notes and didn't understand why it didn't crash anymore. My tests:
[root@router]~# uname -a
FreeBSD router.bsdrp.net 11.2-RELEASE FreeBSD 11.2-RELEASE r335510M amd64
[root@router]~# pkg info | grep frr
frr5-5.0 IP routing protocol suite including BGP, IS-IS, OSPF and RIP
[root@router]~# ifconfig tun create
tun0
[root@router]~# ifconfig tun0 up
[root@router]~# service frr onestart
Starting zebra.
2018/06/29 11:48:02 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 11:48:02 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 11:48:02 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 11:48:02 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 11:48:02 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 11:48:02 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 11:48:02 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 11:48:02 warnings: ZEBRA: warning: connected_add_ipv6 called for interface tun0 with peer flag set, but no peer address supplied
2018/06/29 11:48:02 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 11:48:02 warnings: ZEBRA: Disabling MPLS support (no kernel support)
Starting ripd.
Starting ripngd.
Starting ospfd.
Starting ospf6d.
Starting bgpd.
Starting isisd.
Starting eigrpd.
Starting babeld.
[root@router]~# cli
Hello, this is FRRouting (version 5.0).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
router.bsdrp.net# sh int tun0
Interface tun0 is up, line protocol is up
Link ups: 1 last: 2018/06/29 11:48:02.02
Link downs: 0 last: (never)
PTM status: disabled
vrf: Default-IP-Routing-Table
index 4 metric 1 mtu 1500 speed 0
flags: <UP,POINTOPOINT,RUNNING,MULTICAST>
Type: PPP
inet6 fe80::5a9c:fcff:fe01:1/64
Interface Type Other
input packets 0, bytes 0, dropped 0, multicast packets 0
input errors 0
output packets 0, bytes 0, multicast packets 0
output errors 0
collisions 0
It starts up for me as well. I still get the all those warnings. Not sure if thats an issue or not, or there are other silent problems :( I built and tested using the default config instructions. I did notice a boat load of ../lib/frratomic.h:65:1: warning: "_Atomic" redefined warnings
)# zebra -d -A127.0.0.1
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 12:26:07 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 12:26:07 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 12:26:07 warnings: ZEBRA: Disabling MPLS support (no kernel support)
0(cage)# bgpd -d -A127.0.0.1
2018/06/29 12:26:11 BGP: bgpd 5.0-MyOwnFRRVersion starting: vty@2605, bgp@
Hello, this is FRRouting (version 5.0-MyOwnFRRVersion). Copyright 1996-2005 Kunihiro Ishiguro, et al.
User Access Verification
Password:
I confirm this bug on 4.0:
│200 /* Called from if_up(). */ │
│201 void connected_up(struct interface *ifp, struct connected *ifc) │
│202 { │
│203 afi_t afi; │
│204 struct prefix p; │
│205 struct nexthop nh = { │
│206 .type = NEXTHOP_TYPE_IFINDEX, .ifindex = ifp->ifindex, │
│207 }; │
│208 │
│209 if (!CHECK_FLAG(ifc->conf, ZEBRA_IFC_REAL)) │
│210 return; │
│211 │
>│212 PREFIX_COPY(&p, CONNECTED_PREFIX(ifc)); │
│213 │
On 5.x this crash is not happening. My guess it that one of these two commits fixed the problem: 60c0687a9 or f52d0a1a7. I need to leave now but I'll check once I get back home.
Regarding the warnings, they are harmless, but I'll try to find a way to silence them.
ifam_read() doesn't read all socket data
) deserves a bit more of attention, it's unclear to me why it's happening so I'll leave to investigate it later in more detail.@rwestphal have any news about:
ifam_read() doesn't read all socket data
@pautiina please try my PR #3419 .
@rzalamena
Hello, this is FRRouting (version 6.1-dev-g9f2c1ff-dirty).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
This is a git build of frr-6.1-dev-289-gc69f2c1ff-dirty
Associated branch(es):
local:freebsd-route-warning-fix
github/opensourcerouting/frr.git/freebsd-route-warning-fix
github/opensourcerouting/frr.git/freebsd-route-warning-fix2
fixed
I noticed that if a tunnel interface created by OpenVPN on FreeBSD 11 (AMD64) is active at the time zebra tries to start up, it fails.
Starting with truss shows
If openvpn is not running, it starts up, but still with many warnings that 3.x did not generate:
This is from the port config.log shows