-
Notifications
You must be signed in to change notification settings - Fork 222
Description
Describe the request
Recursive locks possible in the following code (may also be in other locations):
cFE/fsw/cfe-core/src/sb/cfe_sb_api.c
Lines 1110 to 1113 in dc3d62b
CFE_EVS_SendEventWithAppID(CFE_SB_SUBSCRIPTION_REMOVED_EID,CFE_EVS_EventType_DEBUG,CFE_SB.AppId, | |
"Subscription Removed:Msg 0x%x on pipe %d,app %s", | |
(unsigned int)CFE_SB_MsgIdToValue(MsgId), | |
(int)PipeId,CFE_SB_GetAppTskName(TskId,FullName)); |
cFE/fsw/cfe-core/src/sb/cfe_sb_api.c
Lines 1121 to 1124 in dc3d62b
CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_NO_SUBS_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId, | |
"Unsubscribe Err:No subs for Msg 0x%x on %s,app %s", | |
(unsigned int)CFE_SB_MsgIdToValue(MsgId), | |
PipeName,CFE_SB_GetAppTskName(TskId,FullName)); |
cFE/fsw/cfe-core/src/sb/cfe_sb_task.c
Lines 1172 to 1173 in dc3d62b
CFE_EVS_SendEvent(CFE_SB_FULL_SUB_PKT_EID,CFE_EVS_EventType_DEBUG, | |
"Full Sub Pkt %d Sent,Entries=%d,Stat=0x%x\n",(int)SegNum,(int)EntryNum,(unsigned int)Stat); |
cFE/fsw/cfe-core/src/sb/cfe_sb_task.c
Lines 1200 to 1201 in dc3d62b
CFE_EVS_SendEvent(CFE_SB_PART_SUB_PKT_EID,CFE_EVS_EventType_DEBUG, | |
"Partial Sub Pkt %d Sent,Entries=%d,Stat=0x%x",(int)SegNum,(int)EntryNum,(unsigned int)Stat); |
Related - the locking in the SendPrevSubs command handling doesn't look like it really helps since it has to unlock to send the message (same issues as the commands to record route/map info to file), typical use case is to enable subscription reporting, then send all previous subscriptions so may make sense to refactor (and possibly throttle).
To Reproduce
Clear filters on the debug messages and trigger (I stopped SAMPLE_APP to cause the pipe deletion), or just subscribe and unsubscribe twice to trigger CFE_SB_UNSUB_NO_SUBS_EID.
Expected behavior
Avoiding recursive lock could allow for using a more efficient resource on platforms where it's supported.
Code snips
See above.
System observed on:
From code analysis, tested on Ubuntu 18.04.
Additional context
From analysis during #928 and #947
Reporter Info
Jacob Hageman - NASA/GSFC