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

Adding note on SB undefined behavior with SB_PEND_FOREVER and CFE_SB_DeletePipe() #1802

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions modules/core_api/fsw/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ CFE_Status_t CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const c
** calls to #CFE_SB_Subscribe will be automatically removed from the
** SB routing tables. Any messages in the pipe will be discarded.
**
** If this routine is called from one task while execution of another
** task is blocked by a call to CFE_SB_ReceiveBuffer() with TimeOut
** #CFE_SB_PEND_FOREVER, there is no guarantee that
** CFE_SB_ReceiveBuffer() will return.
**
** Applications should not call this routine for all of their
** SB pipes as part of their orderly shutdown process, as the
** pipe will be deleted by the support framework at the
Expand Down Expand Up @@ -434,6 +439,10 @@ CFE_Status_t CFE_SB_TransmitMsg(CFE_MSG_Message_t *MsgPtr, bool IncrementSequenc
** If the pipe is empty, this routine will block until either a new
** message comes in or the timeout value is reached.
**
** There is no guarantee that this routine will return if
** CFE_SB_DeletePipe() is called from another task while this routine
** is blocking with TimeOut #CFE_SB_PEND_FOREVER.
**
** \par Assumptions, External Events, and Notes:
** Note - If an error occurs in this API, the *BufPtr value may be NULL or
** random. Therefore, it is recommended that the return code be tested
Expand Down