SNAS / openbmp

OpenBMP Server Collector
www.openbmp.org
Eclipse Public License 1.0
232 stars 76 forks source link

openbmp segfaults on receiving juniper packet #63

Closed kruisdraad closed 6 years ago

kruisdraad commented 6 years ago

2018-02-28T22:45:59.356399 | INFO | runServer | Ready. Waiting for connections 2018-02-28T22:46:14.805431 | INFO | runServer | Accepted new connection; active connections = 1 2018-02-28T22:46:14.805518 | INFO | runServer | Client Connected => x.x.x.x:54810, sock = 7 2018-02-28T22:46:17.915188 | INFO | ClientThread | Thread started to monitor BMP from router x.x.x.x using socket 7 buffer in bytes = 16777216 2018-02-28T22:46:17.916364 | INFO | ReadIncomingMsg | x.x.x.x: Init message received with length of 201 2018-02-28T22:46:17.916466 | INFO | handleInitMsg | Init message type 0 and length 15 parsed 2018-02-28T22:46:17.916488 | INFO | handleInitMsg | Init message type 0 = Development/LAB 2018-02-28T22:46:17.916494 | INFO | handleInitMsg | Init message type 1 and length 174 parsed 2018-02-28T22:46:17.916500 | INFO | handleInitMsg | Init message type 1 = Juniper Networks, Inc. vmx internet router, kernel FreeBSD JNPR-11.0-20171206.f4cad52_buil, Build date: 2017-12-19 22:58:13 UTC Copyright (c) 1996-2017 Juniper Networks, Inc. 2018-02-28T22:46:17.916505 | INFO | handleInitMsg | Init message type 2 and length 0 parsed

[783996.005135] openbmpd[22981]: segfault at 0 ip 00007fb44f943900 sp 00007fb43e4846e8 error 4 in libc-2.23.so[7fb44f8b8000+1c0000] [784118.662382] openbmpd[23004]: segfault at 0 ip 00007fef72f95900 sp 00007fef69a716e8 error 4 in libc-2.23.so[7fef72f0a000+1c0000] [784271.476091] openbmpd[23058]: segfault at 0 ip 00007f580a04b900 sp 00007f5804b8d6e8 error 4 in libc-2.23.so[7f5809fc0000+1c0000]

following install guide, with cleanly installed / up-to-date ubuntu 16.04 with all-in-one docker, just crashes container couldn't find why

when that didnt work the ubuntu installation guide, all seems to work with latest mysql consumer and kafka, however it just segfaults as shown above.

TimEvens commented 6 years ago

Thanks for reporting this and providing the destials. I see the issue of why we segfault, which I’ll fix tomorrow. What I can’t fix is why JunOS is sending sysName with an empty value (i.e. length 0 for type 2). Technically it’s okay they don’t include sysName, but what that will mean for you is that the router name will fallback to PTR. This normally is not desirable.

Let me provide you a fix to stop the segfault first. Then I think you need to file a bug with JunOS 11.0vmx 20171206 to get the sysName correctly added.

kruisdraad commented 6 years ago

setting the system name resolves it, but its not really a required setting. I just didnt configure it yet.