On 2022-03-29, Claudio Jeker <cje...@diehard.n-r-g.com> wrote: > On Tue, Mar 29, 2022 at 09:53:56AM +0200, Laurent CARON wrote: >> Hi, >> >> I'm happily running several OpenBGPd routers (Openbsd 7.0). >> >> After having applied the folloxing filters (to blackhole traffic from >> certain countries): >> >> include "/etc/bgpd/deny-asn.ru.bgpd" >> include "/etc/bgpd/deny-asn.by.bgpd" >> include "/etc/bgpd/deny-asn.ua.bgpd" >> >> >> # head /etc/bgpd/deny-asn.ru.bgpd >> match from any AS 2148 set { localpref 250 nexthop blackhole } >> match from any AS 2585 set { localpref 250 nexthop blackhole } >> match from any AS 2587 set { localpref 250 nexthop blackhole } >> match from any AS 2599 set { localpref 250 nexthop blackhole } >> match from any AS 2766 set { localpref 250 nexthop blackhole } >> match from any AS 2848 set { localpref 250 nexthop blackhole } >> match from any AS 2854 set { localpref 250 nexthop blackhole } >> match from any AS 2875 set { localpref 250 nexthop blackhole } >> match from any AS 2878 set { localpref 250 nexthop blackhole } >> match from any AS 2895 set { localpref 250 nexthop blackhole } >> >> The bgpd daemon crashes every few days with the following: >> >> Mar 21 11:36:54 bgpgw-004 bgpd[76476]: 338 roa-set entries expired >> Mar 21 12:06:54 bgpgw-004 bgpd[76476]: 36 roa-set entries expired >> Mar 21 12:11:54 bgpgw-004 bgpd[76476]: 82 roa-set entries expired >> Mar 21 12:22:36 bgpgw-004 bgpd[99215]: fatal in RDE: prefix_alloc: Cannot >> allocate memory >> Mar 21 12:22:36 bgpgw-004 bgpd[65049]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[65049]: main: Lost connection to RDE >> Mar 21 12:22:36 bgpgw-004 bgpd[76476]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[76476]: RTR: Lost connection to RDE >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: SE: Lost connection to RDE >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[76476]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: SE: Lost connection to RDE control >> Mar 21 12:22:36 bgpgw-004 bgpd[76476]: fatal in RTR: Lost connection to >> parent >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: Can't send message 61 to RDE, pipe >> closed >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: peer closed imsg connection >> Mar 21 12:22:36 bgpgw-004 bgpd[58155]: SE: Lost connection to parent >> ... >> >> Mar 24 06:34:17 bgpgw-004 bgpd[83062]: 17 roa-set entries expired >> Mar 24 06:54:47 bgpgw-004 bgpd[82782]: fatal in RDE: communities_copy: >> Cannot allocate memory >> Mar 24 06:54:47 bgpgw-004 bgpd[99753]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[83062]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[99753]: main: Lost connection to RDE >> Mar 24 06:54:47 bgpgw-004 bgpd[83062]: RTR: Lost connection to RDE >> Mar 24 06:54:47 bgpgw-004 bgpd[83062]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[83062]: fatal in RTR: Lost connection to >> parent >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: SE: Lost connection to RDE >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: SE: Lost connection to RDE control >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: Can't send message 61 to RDE, pipe >> closed >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: peer closed imsg connection >> Mar 24 06:54:47 bgpgw-004 bgpd[40748]: SE: Lost connection to parent >> ... >> >> Mar 27 13:07:56 bgpgw-004 bgpd[95001]: fatal in RDE: aspath_get: Cannot >> allocate memory >> Mar 27 13:07:56 bgpgw-004 bgpd[84816]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[84816]: main: Lost connection to RDE >> Mar 27 13:07:56 bgpgw-004 bgpd[3118]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[3118]: RTR: Lost connection to RDE >> Mar 27 13:07:56 bgpgw-004 bgpd[3118]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[3118]: fatal in RTR: Lost connection to >> parent >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: SE: Lost connection to RDE >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: SE: Lost connection to RDE control >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: peer closed imsg connection >> Mar 27 13:07:56 bgpgw-004 bgpd[60695]: SE: Lost connection to parent >> >> Is my filter too aggressive for bgpd ? Is there a more efficient way to >> write it ? > > I doubt it is the filters. You run into some sort of memory leak. Please > monitor 'bgpctl show rib mem' output. Also check ps aux | grep bgpd output > to see why and when the memory starts to go up. > With that information it may be possible to figure out where this leak > sits and how to fix it. > > Cheers
Also: check the values for bgpd's login class (as root, "su -c bgpd -" then "ulimit -a"), and are you starting bgpd from the rc-script or by hand?