Fix nasa/cFS#1064, close table fd leak in CFE_TBL_LoadCmd#2774
Draft
Sammy-Dabbas wants to merge 1 commit into
Draft
Fix nasa/cFS#1064, close table fd leak in CFE_TBL_LoadCmd#2774Sammy-Dabbas wants to merge 1 commit into
Sammy-Dabbas wants to merge 1 commit into
Conversation
CFE_TBL_LoadCmd opened the table image file via CFE_TBL_TxnOpenTableLoadFile but never closed the descriptor, leaking one fd per TBL_LOAD until OSAL ran out of descriptors (OS_FS_ERR_NO_FREE_FDS). Add a guarded OS_close before CFE_TBL_TxnFinish, matching the sibling CFE_TBL_TxnLoadFromFile.
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
Describe the contribution
CFE_TBL_LoadCmd opens the table file via CFE_TBL_TxnOpenTableLoadFile but never
closes the descriptor, so every TBL_LOAD leaks one fd until OSAL is exhausted
and OS_OpenCreate returns OS_FS_ERR_NO_FREE_FDS (-14). Adds a guarded OS_close
before CFE_TBL_TxnFinish, matching the sibling CFE_TBL_TxnLoadFromFile.
Fixes nasa/cFS#1064.
Testing performed
Code-level only, not run on a target. Both branches of the new guard are already
covered by tbl_ut_load.c (Test_CFE_TBL_LoadCmd). Left as draft so CI runs the
full build and coverage.
Expected behavior changes
No API change. The load descriptor is released each load, so repeated TBL_LOAD no
longer exhausts OSAL. No change to return codes, counters, or events.
System(s) tested on
Not run on a target; verified against the dev branch. Leak is also present on the
v7.0.1 (Draco) tag cited in the report.
Third party code
None.
Contributor Info
Sammy Dabbas, Personal.