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

lib: fix route map description memory leak #6681

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

rzalamena
Copy link
Member

Summary

Fixes #6659 .

Route map entries are not getting a chance to call description string
deallocation on shutdown or when the parent entry is destroyed, so lets
add a code to handle this in the route_map_index_delete function.

This PR might need to be backported to 7.4.

@LabN-CI
Copy link
Collaborator

LabN-CI commented Jul 6, 2020

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/6681 0f626a2
Date 07/06/2020
Start 10:45:32
Finish 11:11:26
Run-Time 25:54
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-07-06-10:45:32.txt
Log autoscript-2020-07-06-10:46:29.log.bz2
Memory 496 485 423

For details, please contact louberger

@donaldsharp
Copy link
Member

LGTM I'll push in once CI finishes

lib/routemap.c Outdated
@@ -971,6 +971,10 @@ void route_map_index_delete(struct route_map_index *index, int notify)
zlog_debug("Deleting route-map %s sequence %d",
index->map->name, index->pref);

/* Free route map entry description. */
if (index->description)
Copy link
Member

Choose a reason for hiding this comment

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

No check please

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

Route map entries are not getting a chance to call `description` string
deallocation on shutdown or when the parent entry is destroyed, so lets
add a code to handle this in the `route_map_index_delete` function.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Jul 6, 2020

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12972/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12972/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-g0f626a268-0 (missing) -> 7.5-dev-20200706-00-g0f626a268-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-g0f626a268-0 (missing) -> 7.5-dev-20200706-00-g0f626a268-0~deb10u1
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-g0f626a268-0 (missing) -> 7.5-dev-20200706-00-g0f626a268-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-g0f626a268-0 (missing) -> 7.5-dev-20200706-00-g0f626a268-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-g0f626a268-0 (missing) -> 7.5-dev-20200706-00-g0f626a268-0~deb10u1

Copy link
Member

@qlyoung qlyoung left a comment

Choose a reason for hiding this comment

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

lgtm

@qlyoung qlyoung merged commit 4bcc499 into FRRouting:master Jul 6, 2020
@LabN-CI
Copy link
Collaborator

LabN-CI commented Jul 6, 2020

💚 Basic BGPD CI results: SUCCESS, 0 tests failed

Results table
_ _
Result SUCCESS git merge/6681 f095133
Date 07/06/2020
Start 12:40:33
Finish 13:06:18
Run-Time 25:45
Total 1815
Pass 1815
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2020-07-06-12:40:33.txt
Log autoscript-2020-07-06-12:41:32.log.bz2
Memory 456 492 425

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, this patch passed basic tests

Tested-by: NetDEF / OpenSourceRouting.org CI System

CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12974/

This is a comment from an automated CI system.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

Warnings Generated during build:

Debian 10 amd64 build: Successful with additional warnings

Debian Package lintian failed for Debian 10 amd64 build:
(see full package build log at https://ci1.netdef.org/browse/FRR-FRRPULLREQ-12974/artifact/DEB10BUILD/ErrorLog/log_lintian.txt)

W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr source: pkg-js-tools-test-is-missing
W: frr source: newer-standards-version 4.4.1 (current is 4.3.0)
W: frr-doc: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-gf09513358-0 (missing) -> 7.5-dev-20200706-00-gf09513358-0~deb10u1
W: frr-rpki-rtrlib: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-gf09513358-0 (missing) -> 7.5-dev-20200706-00-gf09513358-0~deb10u1
W: frr-snmp: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-gf09513358-0 (missing) -> 7.5-dev-20200706-00-gf09513358-0~deb10u1
W: frr: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-gf09513358-0 (missing) -> 7.5-dev-20200706-00-gf09513358-0~deb10u1
W: frr-pythontools: changelog-file-missing-explicit-entry 6.0-2 -> 7.5-dev-20200706-00-gf09513358-0 (missing) -> 7.5-dev-20200706-00-gf09513358-0~deb10u1

@rzalamena rzalamena deleted the rmap-desc-leak-fix branch July 6, 2020 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

description line in route-maps leaks memory
5 participants