-
Notifications
You must be signed in to change notification settings - Fork 149
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
Valgrind memory leak fixes #43
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"libnuma: cleanup nodemask in destructor"
-- Joe |
Can you remove the free() on error exits in numademo? That's too ugly. Freeing on normal exit is ok. |
Free node_cpu_mask_v2[] bitmap-pointer-array and all of the bitmaps that it points to. Fixes the following valgrind warnings: 16 bytes in 1 blocks are still reachable in loss record 1 of 3 at 0x4C28BE3: malloc (vg_replace_malloc.c:299) by 0x4E37E05: numa_bitmask_alloc (libnuma.c:210) by 0x4E3998E: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1381) by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718) by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo) by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo) 512 bytes in 1 blocks are still reachable in loss record 2 of 3 at 0x4C2A975: calloc (vg_replace_malloc.c:711) by 0x4E37E24: numa_bitmask_alloc (libnuma.c:214) by 0x4E3998E: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1381) by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718) by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo) by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo) 8,192 bytes in 1 blocks are still reachable in loss record 3 of 3 at 0x4C2A975: calloc (vg_replace_malloc.c:711) by 0x4E39974: init_node_cpu_mask_v2 (libnuma.c:1266) by 0x4E39974: numa_node_to_cpus@@libnuma_1.2 (libnuma.c:1361) by 0x4E3A3C9: numa_run_on_node (libnuma.c:1718) by 0x402DB5: test (in /home/sansharm/src/numactl/.libs/numademo) by 0x401672: main (in /home/sansharm/src/numactl/.libs/numademo) Signed-off-by:Sanskriti Sharma <sansharm@redhat.com>
Free the test nodemasks after each test. Fixes the following valgrind warnings: 128 bytes in 1 blocks are indirectly lost in loss record 10 of 20 at 0x4C2A975: calloc (vg_replace_malloc.c:711) by 0x4E37E84: numa_bitmask_alloc (libnuma.c:214) by 0x402CEB: test (in /home/sansharm/src/numactl/.libs/numademo) by 0x401661: main (in /home/sansharm/src/numactl/.libs/numademo) 144 (16 direct, 128 indirect) bytes in 1 blocks are definitely lost in loss record 11 of 20 at 0x4C28BE3: malloc (vg_replace_malloc.c:299) by 0x4E37E65: numa_bitmask_alloc (libnuma.c:210) by 0x402A07: test (in /home/sansharm/src/numactl/.libs/numademo) by 0x401612: main (in /home/sansharm/src/numactl/.libs/numademo) Signed-off-by:Sanskriti Sharma <sansharm@redhat.com>
Frees pointer node_to_use before exiting program. Fixes the following valgrind warnings: 4 bytes in 1 blocks are still reachable in loss record 1 of 1 at 0x4C28BE3: malloc (vg_replace_malloc.c:299) by 0x402973: get_node_list (in /home/sansharm/src/numactl/.libs/numademo) by 0x401450: main (in /home/sansharm/src/numactl/.libs/numademo) Signed-off-by: Sanskriti Sharma <sansharm@redhat.com>
v2:
|
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes valgrind warnings when running: