Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to check the status of CFE_TBL_Load() call #147

Closed
jphickey opened this issue May 17, 2021 · 0 comments · Fixed by #190
Closed

Need to check the status of CFE_TBL_Load() call #147

jphickey opened this issue May 17, 2021 · 0 comments · Fixed by #190
Labels
enhancement New feature or request

Comments

@jphickey
Copy link
Contributor

jphickey commented May 17, 2021

Describe the bug
sample_app does not actually check the status returned by the call to CFE_TBL_Load(). As a result, if the filename is wrong or missing, it is not obvious that the app has not initialized itself fully, because it still prints the "SAMPLE App Initialized" message as usual.

To Reproduce
Start CFE framework as normal but without the sample app table file present in the /cf directory. The sample app still starts "successfully" as reported in the message but the table is not loaded.

Expected behavior
The app shouldn't report that it initialized if the table didn't load.

Code snips
The status is saved to a local variable here, but nothing is done with it:

else
{
status = CFE_TBL_Load(SAMPLE_APP_Data.TblHandles[0], CFE_TBL_SRC_FILE, SAMPLE_APP_TABLE_FILE);
}
CFE_EVS_SendEvent(SAMPLE_APP_STARTUP_INF_EID, CFE_EVS_EventType_INFORMATION, "SAMPLE App Initialized.%s",
SAMPLE_APP_VERSION_STRING);
return (CFE_SUCCESS);
} /* End of SAMPLE_APP_Init() */

System observed on:
Ubuntu 20.04

Additional context
Surprising that this is not reported by static analysis, as it seems to be a case of variable assignment without use.

Also worth noting that table services itself does send an event about the failure to load the table, but it doesn't have much detail:
EVS Port1 66/1/CFE_TBL 53: SAMPLE_APP: Unable to open file (FileDescriptor=-1)

If OSAL debug is enabled (OSAL_CONFIG_DEBUG_PRINTF) then the user does get a message on the console, at least on Linux, with more detail ("No such file or directory").

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@skliper skliper added the enhancement New feature or request label Oct 22, 2021
dzbaker added a commit that referenced this issue Nov 13, 2023
…f-CFE_TBL_Load-fails

Fix #147, Add check for success of CFE_TBL_Load() during Initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants