osrg / gobgp

BGP implemented in the Go Programming Language
https://osrg.github.io/gobgp/
Apache License 2.0
3.59k stars 684 forks source link

SIGSEGV when asking gobgp 3.6.0 the Adj-RIB-In of a neighbor for address family LS #2571

Open skippylegrandgourou opened 2 years ago

skippylegrandgourou commented 2 years ago

Hello. We encountered a segmentation violation when asking gobgp 3.6.0 the Adj-RIB-In of a neighbor for address family LS. The problem was the same with the 3.4.0 version. We receive well about 6000 routes describing the L2 area of our backbone as well as another L1 area from a Juniper L1/L2 IS-IS router but we are not able to consult the Adj-RIB-In since we obtain the following output.

gobgp@LINUX:~$ gobgp --version version gobgp version 3.6.0

gobgp@LINUX:~$ gobgp monitor adj-in X.X.X.X --address-family ls --current rpc error: code = ResourceExhausted desc = grpc: received message larger than max (16289552 vs. 4194304)

gobgp@LINUX:~$ gobgp neighbor X.X.X.X --address-family ls BGP neighbor is X.X.X.X, remote AS NNNN BGP version 4, remote router ID X.X.X.X BGP state = ESTABLISHED, up for 00:25:02 BGP OutQ = 0, Flops = 0 Hold time is 90, keepalive interval is 30 seconds Configured hold time is 90, keepalive interval is 30 seconds

Neighbor capabilities: multiprotocol: ls: advertised and received route-refresh: advertised and received extended-nexthop: advertised Local: nlri: ls, nexthop: ipv6 graceful-restart: received Remote: notification flag set 4-octet-as: advertised and received long-lived-graceful-restart: received fqdn: advertised Local: name: LINUX, domain: cisco-route-refresh: received Message statistics: Sent Rcvd Opens: 1 1 Notifications: 0 0 Updates: 0 2534 Keepalives: 51 54 Route Refresh: 0 0 Discarded: 0 0 Total: 52 2589 Route statistics: Advertised: 0 Received: 5918 Accepted: 5918

gobgp@LINUX:~$ gobgp neighbor X.X.X.X --address-family ls adj-in panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x3c pc=0x86901ed]

goroutine 1 [running]: main.makeShowRouteArgs(0x972e000, 0x0, {0xc0bdef49399a8d68, 0x3070a22c, 0x8d8b060}, 0x1, 0x0, 0x0, 0x1) /home/runner/work/gobgp/gobgp/cmd/gobgp/neighbor.go:611 +0x9cd main.showRoute({0xb5de000, 0x1716, 0x1800}, 0x1, 0x0, 0x0, 0x1) /home/runner/work/gobgp/gobgp/cmd/gobgp/neighbor.go:621 +0x9e9 main.showNeighborRib({0x87f5b8d, 0x6}, {0x96861d0, 0xe}, {0x940dc50, 0x0, 0x1}) /home/runner/work/gobgp/gobgp/cmd/gobgp/neighbor.go:989 +0xc64 main.newNeighborCmd.func1(0x962cdc0, {0x940dc50, 0x1, 0x1}) /home/runner/work/gobgp/gobgp/cmd/gobgp/neighbor.go:1378 +0x20a github.com/spf13/cobra.(Command).execute(0x962cdc0, {0x940dc30, 0x1, 0x1}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x645 github.com/spf13/cobra.(Command).ExecuteC(0x962c9a0) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x403 github.com/spf13/cobra.(Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902 main.newNeighborCmd.func6(0x9630c60, {0x957fea0, 0x2, 0x4}) /home/runner/work/gobgp/gobgp/cmd/gobgp/neighbor.go:1467 +0xfb github.com/spf13/cobra.(Command).execute(0x9630c60, {0x957fe80, 0x4, 0x4}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:860 +0x645 github.com/spf13/cobra.(Command).ExecuteC(0x9523080) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x403 github.com/spf13/cobra.(Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:902 main.main() /home/runner/work/gobgp/gobgp/cmd/gobgp/main.go:32 +0x109

Thanks in advance for your support.

fujita commented 2 years ago

Without current option, works?

skippylegrandgourou commented 1 year ago

Hello. Sorry for responding so late. Without the "--current", the command is accepted. To get some BGP updates, we have done a soft refresh on our router in order to send again all the NLRIs and we get 6116 lines (the exact number of NLRI) of this type: "2022-09-12T08:20:54Z [ROUTE] %!s() via fictitious aspath [] attrs []". Thanks in advance.