Skip to content

Fix nasa/cFS#1064, close table fd leak in CFE_TBL_LoadCmd#2774

Draft
Sammy-Dabbas wants to merge 1 commit into
nasa:devfrom
Sammy-Dabbas:fix-1064-close-table-load-fd
Draft

Fix nasa/cFS#1064, close table fd leak in CFE_TBL_LoadCmd#2774
Sammy-Dabbas wants to merge 1 commit into
nasa:devfrom
Sammy-Dabbas:fix-1064-close-table-load-fd

Conversation

@Sammy-Dabbas

Copy link
Copy Markdown

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CFE Table Load command fails due to inability to open the file

2 participants