fabrics: fix valgrind errors for connect-all using JSON config file#3033
Merged
igaw merged 2 commits intolinux-nvme:masterfrom Jan 5, 2026
Merged
fabrics: fix valgrind errors for connect-all using JSON config file#3033igaw merged 2 commits intolinux-nvme:masterfrom
igaw merged 2 commits intolinux-nvme:masterfrom
Conversation
Valgrind complained about a conditional jump or move depending on an uninitialized value created by a stack allocation at _nvmf_discovery(): ==16682== Conditional jump or move depends on uninitialised value(s) ==16682== at 0x4879DA5: _nvmf_discovery (fabrics.c:2198) ==16682== by 0x487B341: _discovery_config_json (fabrics.c:2424) ==16682== by 0x487B549: nvmf_discovery_config_json (fabrics.c:2461) ==16682== by 0x409A70: fabrics_discovery (fabrics.c:569) ==16682== by 0x446358: handle_plugin (plugin.c:190) ==16682== by 0x407760: main (nvme.c:11029) ==16682== Uninitialised value was created by a stack allocation ==16682== at 0x4879AF2: _nvmf_discovery (fabrics.c:2102) Fix the same. Signed-off-by: Martin George <[email protected]>
Valgrind revealed a mem leak caused due to not invoking parser_cleanup for the corresponding parser_init at nvmf_discovery_config_file(): ==16682== 256 bytes in 1 blocks are definitely lost in loss record 1 of 2 ==16682== at 0x4848C31: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==16682== by 0x40881A: cb_parser_init (fabrics.c:254) ==16682== by 0x487B8A2: nvmf_discovery_config_file (fabrics.c:2554) ==16682== by 0x4099F6: fabrics_discovery (fabrics.c:574) ==16682== by 0x446358: handle_plugin (plugin.c:190) ==16682== by 0x407760: main (nvme.c:11029) ==16682== ==16682== 472 bytes in 1 blocks are still reachable in loss record 2 of 2 ==16682== at 0x4841984: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==16682== by 0x494C7CA: __fopen_internal (in /lib64/libc.so.6) ==16682== by 0x408802: cb_parser_init (fabrics.c:248) ==16682== by 0x487B8A2: nvmf_discovery_config_file (fabrics.c:2554) ==16682== by 0x4099F6: fabrics_discovery (fabrics.c:574) ==16682== by 0x446358: handle_plugin (plugin.c:190) ==16682== by 0x407760: main (nvme.c:11029) Fix the same. Signed-off-by: Martin George <[email protected]>
Collaborator
|
Nice! Thanks a lot! |
This file contains hidden or 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
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.
Valgrind revealed multiple errors during a nvme connect-all while using the JSON config file. Fix the same.