fix(tbl): close file descriptor after table load command - #2830
Open
philphauler wants to merge 1 commit into
Open
fix(tbl): close file descriptor after table load command#2830philphauler wants to merge 1 commit into
philphauler wants to merge 1 commit into
Conversation
Fixes nasa#2811: CFE_TBL_LoadCmd opens a file via TxnOpenTableLoadFile but never closes it — TxnFinish only releases the registry lock. Every load command leaks one OS file descriptor, eventually exhausting the OSAL file table.
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.
Checklist (Please check before submitting)
Describe the contribution
Fixes #2811. In
CFE_TBL_LoadCmd(), the file descriptor opened byCFE_FS_OpenFileForReading()is never closed on any code path — success or error. Added 6 lines using the establishedOS_ObjectIdDefined()+OS_close()idiom already present in the codebase to close the descriptor afterCFE_TBL_SetMetaDataFromFileHeader(), beforeCFE_TBL_TxnFinish().Testing performed
Traced all code paths through
CFE_TBL_LoadCmd()in cFE dev branch HEAD — confirmed no existingOS_close()call on the file descriptor opened at the start of the function. The fix follows the same pattern used elsewhere in the table module.Expected behavior changes
Table load commands no longer leak the opened file descriptor. Repeated table loads no longer accumulate leaked descriptors.
System(s) tested on
Hardware: PC, OS: Windows 11, Versions: cFE dev branch HEAD
Contributor Info
Filip Koscak - phil.phaulre@gmail.com