Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isisd of FRR 5.0 crash with FreeBSD ng (netgraph) interfaces and inet6 #2584

Closed
ocochard opened this issue Jun 29, 2018 · 3 comments
Closed
Assignees
Labels

Comments

@ocochard
Copy link
Contributor

Here is a simple setup, with a netgraph interface (PPP interfaces) where I would like to enable ISIS inet6, but FRR 5.0 isisd crash (no problem with FRR 3 or 4):

[root@R4]~# cat /usr/local/etc/frr/isisd.conf
interface ng1
 ipv6 router isis BSDRP
!
router isis BSDRP
 net 49.0001.1720.1600.4004.00
 metric-style wide
[root@router]~# ifconfig ng1
ng1: flags=88d1<UP,POINTOPOINT,RUNNING,NOARP,SIMPLEX,MULTICAST> metric 0 mtu 1500
        inet6 fe80::5a9c:fcff:fe03:404%ng1 prefixlen 64 scopeid 0x9
        inet6 2001:db8:24::4 prefixlen 64
        inet 10.6.24.4 --> 10.6.24.2 netmask 0xffffffff
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
[root@R4]~# ping6 -c 2 2001:db8:24::2
PING6(56=40+8+8 bytes) 2001:db8:24::4 --> 2001:db8:24::2
16 bytes from 2001:db8:24::2, icmp_seq=0 hlim=64 time=9.082 ms
16 bytes from 2001:db8:24::2, icmp_seq=1 hlim=64 time=10.448 ms

--- 2001:db8:24::2 ping6 statistics ---
2 packets transmitted, 2 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 9.082/9.765/10.448/0.683 ms
[root@R4]~# service frr start                                                                                                                                                       
Starting zebra.
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng0 with peer flag set, but no peer address supplied
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng1 with peer flag set, but no peer address supplied
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 warnings: ZEBRA: warning: connected_add_ipv6 called for interface ng1 with peer flag set, but no peer address supplied
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: ifam_read() doesn't read all socket data
2018/06/29 14:45:16 errors: ZEBRA: if_ioctl(SIOCGIFMEDIA) failed: Invalid argument
2018/06/29 14:45:16 warnings: ZEBRA: Disabling MPLS support (no kernel support)
Checking ripd.conf
OK
Starting ripd.
Checking ripngd.conf
OK
Starting ripngd.
Checking ospfd.conf
OK
Starting ospfd.
Checking ospf6d.conf
OK
Starting ospf6d.
Checking bgpd.conf
OK
Starting bgpd.
Checking isisd.conf
OK
Checking eigrpd.conf
OK
Starting eigrpd.
Checking babeld.conf
OK
Starting babeld.
[root@R4]~# pgrep isisd || echo not found
not found
[root@R4]~# isisd
core_handler: showing active allocations in memory group libfrr
core_handler: memstats:  Redistribution instance IDs   :      3 *          2
core_handler: memstats:  Zclient                       :      1 *       2872
core_handler: memstats:  VRF bit-map                   :     82 * (variably sized)
core_handler: memstats:  VRF                           :      1 *        184
core_handler: memstats:  Vector index                  :   5321 * (variably sized)
core_handler: memstats:  Vector                        :   5321 *         16
core_handler: memstats:  Thread stats                  :     12 *         64
core_handler: memstats:  Thread master                 :      3 * (variably sized)
core_handler: memstats:  Thread                        :     13 * (variably sized)
core_handler: memstats:  Route table                   :      4 *         48
core_handler: memstats:  Stream data                   :      5 * (variably sized)
core_handler: memstats:  Stream                        :      5 *         40
core_handler: memstats:  Skip Node                     :      8 *        160
core_handler: memstats:  Skip List                     :      4 *         56
core_handler: memstats:  Prefix                        :     14 *         40
core_handler: memstats:  Priority queue data           :      1 *        256
core_handler: memstats:  Priority queue                :      1 *         32
core_handler: memstats:  Temporary memory              :      1 * (variably sized)
core_handler: memstats:  Logging                       :      1 *         72
core_handler: memstats:  Link Node                     :     71 *         24
core_handler: memstats:  Link List                     :     52 *         40
core_handler: memstats:  Connected                     :      6 *         40
core_handler: memstats:  Interface                     :      5 *        400
core_handler: memstats:  Hook entry                    :      2 *         48
core_handler: memstats:  Hash Index                    :     38 * (variably sized)
core_handler: memstats:  Hash Bucket                   :    499 *         32
core_handler: memstats:  Hash                          :     76 * (variably sized)
core_handler: memstats:  Graph Node                    :   2642 *         32
core_handler: memstats:  Graph                         :     16 *          8
core_handler: memstats:  Command Argument Name         :    283 * (variably sized)
core_handler: memstats:  Command Token Help            :   1705 * (variably sized)
core_handler: memstats:  Command Token Text            :   1705 * (variably sized)
core_handler: memstats:  Command Tokens                :   2169 *         72
core_handler: memstats:  Host config                   :      2 * (variably sized)
core_handler: memstats:  Buffer                        :      1 *         24
core_handler: showing active allocations in memory group isisd
core_handler: memstats:  ISIS TLVs                     :      8 * (variably sized)
core_handler: memstats:  ISIS MT Area Setting          :      1 *          4
core_handler: memstats:  ISIS MPLS_TE parameters       :      4 *        144
core_handler: memstats:  ISIS dictionary node          :      2 *         48
core_handler: memstats:  ISIS dictionary               :      2 *        104
core_handler: memstats:  ISIS vertex                   :      2 *         80
core_handler: memstats:  ISIS SPFtree                  :      4 *        104
core_handler: memstats:  ISIS area address             :      1 *         21
core_handler: memstats:  ISIS area                     :      1 *       3408
core_handler: memstats:  ISIS LSP                      :      2 *        344
core_handler: memstats:  ISIS circuit                  :      4 *        704
core_handler: memstats:  ISIS                          :      1 *        160
Abort
[root@R4]~# gdb isisd
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...(no debugging symbols found)...
(gdb) run
Starting program: /usr/local/sbin/isisd
(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no
 debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0000000000418f9b in send_hello ()
(gdb) quit
ocochard added a commit to ocochard/BSDRP that referenced this issue Jun 29, 2018
@rwestphal
Copy link
Member

rwestphal commented Jun 29, 2018

I've managed to reproduce this issue on FreeBSD 11.1.

isisd is crashing here (circuit->area is NULL):

   │1497    static void put_hello_hdr(struct isis_circuit *circuit, int level,        │
   │1498                              size_t *len_pointer)                            │
   │1499    {                                                                         │
   │1500            uint8_t pdu_type;                                                 │
   │1501                                                                              │
   │1502            if (circuit->circ_type == CIRCUIT_T_BROADCAST)                    │
   │1503                    pdu_type = (level == IS_LEVEL_1) ? L1_LAN_HELLO : L2_LAN_H│
   │1504            else                                                              │
   │1505                    pdu_type = P2P_HELLO;                                     │
   │1506                                                                              │
   │1507            isis_circuit_stream(circuit, &circuit->snd_stream);               │
   │1508            fill_fixed_hdr(pdu_type, circuit->snd_stream);                    │
   │1509                                                                              │
   │1510            stream_putc(circuit->snd_stream, circuit->is_type);               │
  >│1511            stream_put(circuit->snd_stream, circuit->area->isis->sysid,       │
   │1512                       ISIS_SYS_ID_LEN);

and zebra is crashing here:

   │617     static int zserv_handle_client_close(struct thread *thread)               │
   │618     {                                                                         │
   │619             struct zserv *client = THREAD_ARG(thread);                        │
   │620                                                                               │
   │621             /*                                                                │
   │622              * Ensure these have been nulled. This does not equate to the     │
   │623              * associated task(s) being scheduled or unscheduled on the client│
   │624              * pthread's threadmaster.                                        │
   │625              */                                                               │
   │626             assert(!client->t_read);                                          │
  >│627             assert(!client->t_write);                                         │

@rwestphal rwestphal added the bug label Jun 29, 2018
@donaldsharp
Copy link
Member

The zebra crash I have opened up an issue about already.

@donaldsharp
Copy link
Member

Appears to be a P2P link, not a netgraph link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants