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

pim6d: Fix memory leaks #14792

Merged
merged 1 commit into from
Nov 15, 2023
Merged

pim6d: Fix memory leaks #14792

merged 1 commit into from
Nov 15, 2023

Conversation

mobash-rasool
Copy link
Contributor

@mobash-rasool mobash-rasool commented Nov 14, 2023

Problem Statement:
Mentioning few of the leaks here:

=3843268== 6 bytes in 3 blocks are still reachable in loss record 1 of 29
==3843268== at 0x483C855: malloc (vg_replace_malloc.c:381)
==3843268== by 0x489ED0E: qmalloc (memory.c:106)
==3843268== by 0x48DE8DB: redist_add_instance (zclient.c:125)
==3843268== by 0x48DF561: zclient_init (zclient.c:647)
==3843268== by 0x14FFA3: pim_zebra_init (pim_zebra.c:527)
==3843268== by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 2 of 29
==3843268== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268== by 0x489EE03: qcalloc (memory.c:111)
==3843268== by 0x4878DDE: buffer_new (buffer.c:72)
==3843268== by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268== by 0x14FF1D: pim_zebra_init (pim_zebra.c:516)
==3843268== by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 3 of 29
==3843268== at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268== by 0x489EE03: qcalloc (memory.c:111)
==3843268== by 0x4878DDE: buffer_new (buffer.c:72)
==3843268== by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268== by 0x150A3D: zclient_lookup_new (pim_zlookup.c:131)
==3843268== by 0x11D021: main (pim6_main.c:178)

RCA:
Memory is allocated when the daemon started but
it is not freed when terminated.

Fix:
Freeing the memory when daemon goes down.

Problem Statement:
========================
Mentioning few of the leaks here:

=3843268== 6 bytes in 3 blocks are still reachable in loss record 1 of 29
==3843268==    at 0x483C855: malloc (vg_replace_malloc.c:381)
==3843268==    by 0x489ED0E: qmalloc (memory.c:106)
==3843268==    by 0x48DE8DB: redist_add_instance (zclient.c:125)
==3843268==    by 0x48DF561: zclient_init (zclient.c:647)
==3843268==    by 0x14FFA3: pim_zebra_init (pim_zebra.c:527)
==3843268==    by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 2 of 29
==3843268==    at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268==    by 0x489EE03: qcalloc (memory.c:111)
==3843268==    by 0x4878DDE: buffer_new (buffer.c:72)
==3843268==    by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268==    by 0x14FF1D: pim_zebra_init (pim_zebra.c:516)
==3843268==    by 0x11D021: main (pim6_main.c:178)
==3843268==
==3843268== 24 bytes in 1 blocks are still reachable in loss record 3 of 29
==3843268==    at 0x484147B: calloc (vg_replace_malloc.c:1328)
==3843268==    by 0x489EE03: qcalloc (memory.c:111)
==3843268==    by 0x4878DDE: buffer_new (buffer.c:72)
==3843268==    by 0x48DE7BF: zclient_new (zclient.c:75)
==3843268==    by 0x150A3D: zclient_lookup_new (pim_zlookup.c:131)
==3843268==    by 0x11D021: main (pim6_main.c:178)

RCA:
=======================
Memory is allocated when the daemon started but
it is not freed when terminated.

Fix:
=======================
Freeing the memory when daemon goes down.

Signed-off-by: Mobashshera Rasool <[email protected]>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though I don't see we call route_map_finish() for pim6d, do we?

@mobash-rasool
Copy link
Contributor Author

LGTM, though I don't see we call route_map_finish() for pim6d, do we?

route_map_finish

That is because pim_route_map_init is not called/initialised for pim6d. Therefore not required to be cleaned up.

@ton31337
Copy link
Member

ci:rerun CI stuck

@donaldsharp donaldsharp merged commit 93379c0 into FRRouting:master Nov 15, 2023
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants