-
Notifications
You must be signed in to change notification settings - Fork 204
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
Potential for recursive loop if Event TLM MsgId is incorrect #1952
Comments
It seems the "recursive event" protection is only enabled for CFE_SB_SEND_NO_SUBS_EID. Not sure if this is a historical thing (i.e. if there is a reason this was only done for that particular event) or something recently introduced/oversight with the caelum changes. See Here: cFE/modules/sb/fsw/src/cfe_sb_api.c Lines 1527 to 1537 in 64a6a59
However the same "RequestToSendEvent" is not done for the other events that this function might generate. For a short term fix, any+all events that might be generated from the However, from an architectural standpoint, it doesn't make a whole lot of sense for this recursion protection to be in SB at all. It's really an EVS problem, and SB seems to be protecting EVS from itself here. Rather, EVS should track its per-task state, and if a task tries to send the same event ID while in the process of sending that event ID, it should drop it itself, to break the loop. |
A skim through the other functions in this path (CFE_SB_TransmitMsg, CFE_SB_BroadcastBufferToRoute) show that other events also do have this protection:
So the problem is likely limited to these Event IDs specifically from
All of these EIDs point to a configuration issue as opposed to a runtime issue, which reduces the severity of this issue. |
But important to note in a longer term/system level viewpoint, since Caelum allows components to be overridden/modified, it is not really appropriate for SB to "know" that EVS calls It really calls for EVS to protect itself from recursion in a more generic sense, to ensure that ANY event from ANY app will not get itself into a loop and crash the system. |
Adds CFE_SB_RequestToSendEvent/CFE_SB_FinishSendEvent wrappers around all events generated by CFE_SB_TransmitMsgValidate. This is avoids the potential for a recursive loop if configured improperly.
I'm in favor of treating the current PR as an optional patch if folks want it (since it's a misconfiguration issue), but plan for protecting from within EVS in a future release. |
Adds CFE_SB_RequestToSendEvent/CFE_SB_FinishSendEvent wrappers around all events generated by CFE_SB_TransmitMsgValidate. This is avoids the potential for a recursive loop if configured improperly.
Adds CFE_SB_RequestToSendEvent/CFE_SB_FinishSendEvent wrappers around all events generated by CFE_SB_TransmitMsgValidate. This is avoids the potential for a recursive loop if configured improperly.
Fix nasa#1952, patch for recursive event loop
Fix nasa#1952, patch for recursive event loop
Adds CFE_SB_RequestToSendEvent/CFE_SB_FinishSendEvent wrappers around all events generated by CFE_SB_TransmitMsgValidate. This is avoids the potential for a recursive loop if configured improperly.
Fix nasa#1952, patch for recursive event loop
Describe the bug
If the software bus
CFE_SB_TransmitMsg()
fails to send a message due to a validation failure, it will send an event through EVS.Event Services, in turn, generates a message (LongEventTlm/ShortEventTlm) which is broadcast via software bus.
However if the Event Telemetry MID value (
CFE_EVS_LONG_EVENT_MSG_MID
) is not set correctly (or some other EVS config is bad) such that EVS tries to send event messages which do not validate, a recursive loop ensues and the software eventually segfaults.To Reproduce
(Mis)configure
CFE_EVS_LONG_EVENT_MSG_MID
to a value which will not pass the CFE_SB_TransmitMsgValidate tests. Run CFE, it will get in a recursive loop and eventually segfault/crash as soon as any app sends an event.Expected behavior
Should not do a recursive loop
System observed on:
Ubuntu
Additional context
Should be protection against recursive event loops like this, where if an event fails to send, it should not cause another event to be sent. This protection appears this is not working correctly right now, at least not for EVS messages.
NOTE: To be absolutely clear - the issue described here is a mis-configuration issue. It will not happen in a properly configured system, so long as EVS generates messages which are "transmittable". BUT - there are other events that might be triggered by a CFE_SB_TransmitMsg call, such as a MsgLim error, and its not clear of a similar recursive loop might be possible there (have not tested/investigated).
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: