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

memory leak observed in bgpd at ensure_vrf_tovpn_sid_per_af when srv6l3vpn routeleak topotest are run. #13992

Closed
gpnaveen opened this issue Jul 12, 2023 · 2 comments

Comments

@gpnaveen
Copy link
Contributor

FRR Version:
FRRouting (version 8.5.2).

Linux : Ubuntu 20.04 AMD 64.

Scripts executed:
all the bgp topotests from path 'frr-frr-8.5.2/tests/topotests'
root@frr:/tmp/topotests# cat ./bgp_srv6l3vpn_route_leak.test_bgp_srv6l3vpn_route_leak/pe1.valgrind.bgpd.784117
==784117== Memcheck, a memory error detector
==784117== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==784117== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==784117== Command: /usr/lib/frr/bgpd --command-log-always --log file:bgpd.log --log-level debug -d
==784117== Parent PID: 784116
==784117==
==784117==
==784117== HEAP SUMMARY:
==784117== in use at exit: 1,558,763 bytes in 465 blocks
==784117== total heap usage: 279,506 allocs, 279,041 frees, 20,094,125 bytes allocated
==784117==
==784117== 16 bytes in 1 blocks are definitely lost in loss record 21 of 167
==784117== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==784117== by 0x48EDE23: qcalloc (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x2436DD: ensure_vrf_tovpn_sid_per_af (in /usr/lib/frr/bgpd)
==784117== by 0x248B7F: vpn_leak_postchange_all (in /usr/lib/frr/bgpd)
==784117== by 0x2C3D04: ??? (in /usr/lib/frr/bgpd)
==784117== by 0x493C04C: ??? (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x49299F0: thread_call (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x48E23E7: frr_run (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x1F38AC: main (in /usr/lib/frr/bgpd)
==784117==
==784117== 16 bytes in 1 blocks are definitely lost in loss record 22 of 167
==784117== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==784117== by 0x48EDE23: qcalloc (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x2430BE: vpn_leak_zebra_vrf_sid_update_per_af (in /usr/lib/frr/bgpd)
==784117== by 0x24879A: vpn_leak_postchange_all (in /usr/lib/frr/bgpd)
==784117== by 0x2C3D04: ??? (in /usr/lib/frr/bgpd)
==784117== by 0x493C04C: ??? (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x49299F0: thread_call (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x48E23E7: frr_run (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x1F38AC: main (in /usr/lib/frr/bgpd)
==784117==
==784117== 296 bytes in 1 blocks are definitely lost in loss record 133 of 167
==784117== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==784117== by 0x48EDE23: qcalloc (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x2436C8: ensure_vrf_tovpn_sid_per_af (in /usr/lib/frr/bgpd)
==784117== by 0x248B7F: vpn_leak_postchange_all (in /usr/lib/frr/bgpd)
==784117== by 0x2C3D04: ??? (in /usr/lib/frr/bgpd)
==784117== by 0x493C04C: ??? (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x49299F0: thread_call (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x48E23E7: frr_run (in /usr/lib/x86_64-linux-gnu/frr/libfrr.so.0.0.0)
==784117== by 0x1F38AC: main (in /usr/lib/frr/bgpd)
==784117==
==784117== LEAK SUMMARY:
==784117== definitely lost: 328 bytes in 3 blocks
==784117== indirectly lost: 0 bytes in 0 blocks
==784117== possibly lost: 0 bytes in 0 blocks
==784117== still reachable: 1,558,215 bytes in 459 blocks
==784117== suppressed: 220 bytes in 3 blocks
==784117== Reachable blocks (those to which a pointer was found) are not shown.
==784117== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==784117==
==784117== For lists of detected and suppressed errors, rerun with: -s
==784117== ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)
root@frr:/tmp/topotests#

Command used: inside each folder.
sudo -E pytest -s -v --valgrind-memleaks

Script where leak is seen: bgp_srv6l3vpn_route_leak

@cscarpitta
Copy link
Contributor

Thanks for reporting this. We already have a fix for this memory leak on the master branch: #13554
We should backport it.

@ton31337
Copy link
Member

It's backported, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants