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

"show bgp l2vpn evpn neighbors 52.1.1.1 advertised-routes json" command results in BGP daemon crash #5010

Closed
karamalla0406 opened this issue Sep 18, 2019 · 3 comments
Labels
bgp triage Needs further investigation

Comments

@karamalla0406
Copy link
Contributor

karamalla0406 commented Sep 18, 2019

"show bgp l2vpn evpn neighbors 52.1.1.1 advertised-routes json" results in BGP deamon restart.

Following is the back trace:

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f3768f4370d in poll () at ../sysdeps/unix/syscall-template.S:84
84      ../sysdeps/unix/syscall-template.S: No such file or directory.
(gdb) c
Continuing.

Thread 1 "bgpd" received signal SIGSEGV, Segmentation fault.
0x00007f376963a7a0 in ?? () from /lib/x86_64-linux-gnu/libjson-c.so.2
(gdb) bt
#0  0x00007f376963a7a0 in ?? () from /lib/x86_64-linux-gnu/libjson-c.so.2
#1  0x00007f376963a7a5 in ?? () from /lib/x86_64-linux-gnu/libjson-c.so.2
#2  0x00007f376963a60c in json_object_to_json_string_ext () from /lib/x86_64-linux-gnu/libjson-c.so.2
#3  0x0000000000501a67 in show_adj_route_vpn (vty=vty@entry=0x1189c40, peer=<optimized out>, prd=prd@entry=0x0, afi=afi@entry=AFI_L2VPN, safi=safi@entry=SAFI_EVPN,
    use_json=use_json@entry=true) at bgpd/bgp_vpn.c:210
#4  0x00000000004f38cb in show_ip_bgp_l2vpn_evpn_neighbor_advertised_routes (self=<optimized out>, vty=0x1189c40, argc=7, argv=0x11c4e40) at bgpd/bgp_evpn_vty.c:1514
#5  0x00007f3769b7c57d in cmd_execute_command_real (vline=vline@entry=0x12b9be0, vty=vty@entry=0x1189c40, cmd=cmd@entry=0x0, filter=FILTER_RELAXED) at lib/command.c:1072
#6  0x00007f3769b7e7aa in cmd_execute_command (vline=vline@entry=0x12b9be0, vty=vty@entry=0x1189c40, cmd=0x0, vtysh=vtysh@entry=0) at lib/command.c:1131
#7  0x00007f3769b7e927 in cmd_execute (vty=vty@entry=0x1189c40, cmd=cmd@entry=0x118b310 " show bgp l2vpn evpn neighbors 52.1.1.1 advertised-routes json", matched=matched@entry=0x0,
    vtysh=vtysh@entry=0) at lib/command.c:1285
#8  0x00007f3769bced42 in vty_command (vty=vty@entry=0x1189c40, buf=0x118b310 " show bgp l2vpn evpn neighbors 52.1.1.1 advertised-routes json") at lib/vty.c:516
#9  0x00007f3769bcefc6 in vty_execute (vty=vty@entry=0x1189c40) at lib/vty.c:1285
#10 0x00007f3769bd18dc in vtysh_read (thread=<optimized out>) at lib/vty.c:2119
#11 0x00007f3769bc9980 in thread_call (thread=thread@entry=0x7ffd25cf3e20) at lib/thread.c:1531
#12 0x00007f3769b99eb8 in frr_run (master=0xcdef20) at lib/libfrr.c:1057
#13 0x0000000000420506 in main (argc=4, argv=0x7ffd25cf4188) at bgpd/bgp_main.c:486
(gdb) fr 3
#3  0x0000000000501a67 in show_adj_route_vpn (vty=vty@entry=0x1189c40, peer=<optimized out>, prd=prd@entry=0x0, afi=afi@entry=AFI_L2VPN, safi=safi@entry=SAFI_EVPN,
    use_json=use_json@entry=true) at bgpd/bgp_vpn.c:210
210                     vty_out(vty, "%s\n", json_object_to_json_string_ext(
(gdb) list
205                             }
206                     }
207             }
208             if (use_json) {
209                     json_object_object_add(json, "routes", json_routes);
210                     vty_out(vty, "%s\n", json_object_to_json_string_ext(
211                                                  json, JSON_C_TO_STRING_PRETTY));
212                     json_object_free(json);
213             }
214             return CMD_SUCCESS;

(put "x" in "[ ]" if you already tried following)

FRR Version:

dev# show ver
FRRouting 7.2-dev-MyOwnFRRVersion-g0a0d4f9 (dev).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
This is a git build of frr-7.1-dev-744-g0a0d4f9
Associated branch(es):
        local:master
        github/frrouting/frr.git/master

Configuration:

frr version 7.2-dev-MyOwnFRRVersion
frr defaults traditional
hostname dev
service integrated-vtysh-config
!
vrf vrf-vni10001
 vni 10001
 exit-vrf
!
vrf vrf-vni10002
 vni 10002
 exit-vrf
!
vrf vrf-vni10003
 vni 10003
 exit-vrf
!
router bgp 200
 bgp router-id 5.1.1.2
 neighbor 52.1.1.1 remote-as 100
 neighbor 52.1.1.1 ebgp-multihop 3
 !
 address-family ipv4 unicast
  no neighbor 52.1.1.1 activate
 exit-address-family
 !
 address-family l2vpn evpn
  neighbor 52.1.1.1 activate
  advertise-all-vni
 exit-address-family
!
router bgp 200 vrf vrf-vni10001
 bgp router-id 5.1.1.2
 neighbor 53.1.1.1 remote-as 300
 neighbor 5311::1 remote-as 300
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
!
router bgp 200 vrf vrf-vni10002
 bgp router-id 5.1.1.2
 neighbor 54.1.1.1 remote-as 300
 neighbor 5411::1 remote-as 300
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
!
router bgp 200 vrf vrf-vni10003
 bgp router-id 5.1.1.2
 neighbor 55.1.1.1 remote-as 400
 neighbor 5511::1 remote-as 400
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
  advertise ipv6 unicast
 exit-address-family
!
line vty
!
@lkrishnamoor
Copy link
Contributor

Fix is part of larger diff: #5078

lkrishnamoor added a commit to lkrishnamoor/frr that referenced this issue Sep 27, 2019
Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
lkrishnamoor added a commit to lkrishnamoor/frr that referenced this issue Sep 27, 2019
… json

Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
@ton31337
Copy link
Member

@karamalla0406 I see this is already fixed?

@karamalla0406
Copy link
Contributor Author

I don't see this issue with the latest build. closing it.

SumitAgarwal123 pushed a commit to SumitAgarwal123/frr that referenced this issue Nov 19, 2019
… json

Display output from adj_out instead of the rib table.

Also fixes crash for the json output. RCA: prefix is written to json object
using inet_ntop. But, this api returns null buffer for AF_EVPN address family
(it works only for AF_INET and AF_INET6).  This null buffer is then deref'd
by json-object-to string api.

Full output shown in PR: FRRouting#5078
Crash issue: FRRouting#5010

Signed-off-by: Lakshman Krishnamoorthy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

4 participants