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

CFE_ES_CreateObjects calls CFE_ES_WriteToSysLog while holding shared data lock #591

Closed
thewonderidiot opened this issue Apr 8, 2020 · 0 comments · Fixed by #619 or #649
Closed
Assignees
Labels
Milestone

Comments

@thewonderidiot
Copy link

thewonderidiot commented Apr 8, 2020

Describe the bug
During core service task create, CFE_ES_CreateObjects() calls CFE_ES_WriteToSysLog() while already holding the shared data lock in two places, resulting in a recursive lock / deadlock.

Expected behavior
It appears it should be calling CFE_ES_SysLogWrite_Unsync() instead.

Code snips
The second location makes the issue pretty clear:

                  CFE_ES_WriteToSysLog("ES Startup: Core App: %s created. App ID: %d\n",
                                       CFE_ES_ObjectTable[i].ObjectName,j);
                                       
                  /*
                  ** Increment the registered App and Registered External Task variables.
                  */
                  CFE_ES_Global.RegisteredTasks++;
                  CFE_ES_Global.RegisteredCoreApps++;
                  
                  CFE_ES_UnlockSharedData(__func__,__LINE__);

System observed on:

  • OS: FreeRTOS 10
  • Versions: cFE 6.7.0, OSAL 5.0.0

Reporter Info
Mike Stewart, Capella Space Corporation

@skliper skliper added the bug label Apr 15, 2020
skliper added a commit to skliper/cFS that referenced this issue Apr 15, 2020
skliper added a commit to skliper/cFE that referenced this issue Apr 15, 2020
Now uses CFE_ES_WriteToSysLog_Unsync inside shared data lock
skliper added a commit to skliper/cFE that referenced this issue Apr 15, 2020
Now uses CFE_ES_WriteToSysLog_Unsync inside shared data lock
@skliper skliper self-assigned this Apr 15, 2020
@skliper skliper added this to the 6.8.0 milestone Apr 15, 2020
skliper added a commit to skliper/cFE that referenced this issue Apr 15, 2020
Now uses CFE_ES_SysLogWrite_Unsync inside shared data lock
astrogeco added a commit that referenced this issue Apr 28, 2020
Fix #591, Avoid deadlock in CFE_ES_CreatObjects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants