-
Notifications
You must be signed in to change notification settings - Fork 202
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
Stopping an APP that has a locked mutex using CFE_ES_StopAppCmd BUG #2107
Comments
Possibly related: #701, nasa/osal#470 and the fix in nasa/osal#472. Although this change was for binary semaphores, may need a similar "fix" for a OS_MutSemTake. |
The real problem is trying to create the mutex again when the APP is restarted.
|
There is |
Really the app should clean up after exiting it's run loop that at minimum releases the mutex. See HS as an example (not of mutext cleanup, bun unregistering callbacks and closing child tasks). The CFE_ES_StopAppCmd should cause the CFE_ES_RunLoop to return false and allow the app to clean up. Runloop: https://github.com/nasa/HS/blob/c5ef5acf65ca346270f721e22620e9321a930075/fsw/src/hs_app.c#L120 This approach is likely cleaner/safer than the possible side effects of OSAL trying to clean up and delete a locked mutex... Basically you should never be able to return from the main app routine without unlocking the mutex. That's just bad manners. |
|
Describe the bug
An APP cannot be correctly stopped by CFE_ES if the
CFE_ES_StopAppCmd
is sent in the same moment that the APP has a mutex locked. Although the app is terminated (with errors), when we try to restart it, it doesn't work.To Reproduce
Steps to reproduce the behavior:
OS_MutSemCreate
OS_MutSemTake
CFE_ES_StopAppCmd
using "SAMPLE_APP" as targetCFE_ES_CleanupObjectCallback: Call to OSAL Delete Object (ID:327691) failed. RC=-6
Expected behavior
1.1. In case CFE_ES behavior can't do that, how can we handle apps that have mutexes and may be closed in the exactly same moment that its mutex is locked ("Taken") ?
System observed on:
Additional context
An example:
Reporter Info
Igor Luppi
The text was updated successfully, but these errors were encountered: