Page MenuHomeVyOS Platform

BGPd process crashes with usage of default-originate route-map as-prepend option configured
Closed, ResolvedPublicBUG

Description

Issue: An excessive number of BGP AS-path entries were seen when configured a route-map including set as-path prepend operation with default-originate parameter. This gradually makes the BGP daemon consumes all available memory until the system terminates the process, after which its automatically restarted by watchfrr. This is noticed with large number of BGP updates.

Steps to reproduce the issue:

Configuration(vyos01):

set policy route-map default-origin rule 10 action 'permit'
set policy route-map default-origin rule 10 set as-path prepend '65006 65006'
set protocols bgp address-family ipv4-unicast network 192.168.4.0/24
set protocols bgp neighbor 192.168.0.1 address-family ipv4-unicast
set protocols bgp neighbor 192.168.0.1 remote-as '65002'
set protocols bgp neighbor 192.168.1.3 address-family ipv4-unicast default-originate route-map 'default-origin'
set protocols bgp neighbor 192.168.1.3 address-family ipv4-unicast soft-reconfiguration inbound
set protocols bgp neighbor 192.168.1.3 remote-as '65005'
set protocols bgp system-as '65006'

Use this article link to configure a second router to stimulate large routing table:

https://internal.confluence.vyos.com/wiki/spaces/vsi/pages/147849217/How+to+Simulate+Big+Routing+Tables

The output of as-path count when the default-originate route-map option is configured, this growth will persist even after all BGP updates have been fully processed and the entries doubles the number:

Every 2.0s: sudo vtysh -c 'show memory' | grep aspath                                                                                                        vyos01: Mon Oct 20 15:41:54 2025

BGP aspath                    :  2110099     40    84413400  2110100  84413440
BGP aspath seg                :  2110098     24    50645584  2110099  50645608
BGP aspath segment data       :  2110098 variable  50642480  2110100  50642528
BGP aspath str                :  2110099 variable  84407800  2110100  84407840

vyos@vyos01:~$ show ip bgp summary

IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.1.3, local AS number 65006 vrf-id 0
BGP table version 658793
RIB entries 192044, using 18 MiB of memory
Peers 2, using 40 KiB of memory

Neighbor        V         AS   MsgRcvd   MsgSent   TblVer  InQ OutQ  Up/Down State/PfxRcd   PfxSnt Desc
192.168.0.1     4      65002       363       377   658793    0    0 00:09:33       191824   191827 N/A
192.168.1.3      4      65005       501       524   658793    0    0 07:09:52            0   191828 N/A

When the default-originate option is not configured, these numbers stabilize immediately after the router receives all BGP prefixes and remain relatively constant with same update.

Details

Version
1.4.3
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

zsdc changed the task status from Open to Confirmed.Oct 20 2025, 6:58 PM
zsdc triaged this task as High priority.
zsdc subscribed.

I believe the root cause of this memory leak lies in the default-originate route-map logic. This issue has already been addressed in the FRR upstream with the following commit: FRR Commit 74c1d4f

All versions prior to 10.0 are affected by this bug. To resolve it, we need to backport this change into our FRR build used in VyOS sagitta branch.

Viacheslav claimed this task.
Viacheslav reassigned this task from Viacheslav to dmbaturin.
Viacheslav moved this task from Backlog to Finished on the VyOS 1.4 Sagitta (1.4.4) board.
Viacheslav subscribed.