Repository navigation
Conversation
…pointers ff_unload_config() owns
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.
Detailed descriptions will be shown in #1089.
ff_init()passes the globaldpdk_argv[]straight torte_eal_init(). DPDK's argument parser overwrites one slot with the program name at the end of parsing (lib/eal/linux/eal.c,eal_parse_args()):All F-Stack EAL arguments are options, so
optind == argcanddpdk_argv[argc-1]now points to the same string asdpdk_argv[0]. With the default config, gdb afterrte_eal_init()shows:ff_unload_config()(new in 2.0) frees everydpdk_argv[i], so"f-stack"is freed twice. The originaldpdk_argv[argc-1]string leaks, which is the 17-bytedpdk_args_setupleak reported in #1089 on master. Any config hits this, because-c/-nare always generated.The fix gives EAL a scratch copy of the pointer array, so
dpdk_argv[]keeps the pointersff_unload_config()owns. With the patch, the same repro under ASan runs to the end offf_run()with no double free, and thedpdk_args_setupleak is gone.