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_SB_ReceiveBuffer() -- switch timeout to int32 #1078

Closed
CDKnightNASA opened this issue Jan 8, 2021 · 2 comments · Fixed by #1092
Closed

CFE_SB_ReceiveBuffer() -- switch timeout to int32 #1078

CDKnightNASA opened this issue Jan 8, 2021 · 2 comments · Fixed by #1092
Assignees
Milestone

Comments

@CDKnightNASA
Copy link
Contributor

Describe the bug
Per discussion at the Jan. 6, 2020 CCB, @jphickey suggested that the timeout parameter should be int32, not uint32. This should be changed.

See also #1063

Reporter Info
Christopher.D.Knight@nasa.gov

@CDKnightNASA CDKnightNASA self-assigned this Jan 8, 2021
@jphickey
Copy link
Contributor

jphickey commented Jan 8, 2021

CFE_SB_ReceiveBuffer() is already int32 (see

int32 CFE_SB_ReceiveBuffer(CFE_SB_Buffer_t **BufPtr,
CFE_SB_PipeId_t PipeId,
int32 TimeOut)
{
)

But CFE_SB_ReadBuffer (internal function) is not.

Unless there is a good reason to "hide" OSAL definitions here (and I can't think of a good reason, because everything already depends on osapi.h anyway), I'd rather simplify and just make it so we have:

#define CFE_SB_PEND_FOREVER   OS_PEND
#define CFE_SB_POLL           OS_CHECK

... rather than redefining these values.

Right now we use the same underlying values but redefine them, so to be correct/safe the ReadQueue needs to translate. With them defined this way we still have symbol independence (so SB can diverge from OSAL if it needs to, though I don't know why it would). Then the ReadQueue function doesn't need to translate this value, so long as it shares the same definition.

@jphickey
Copy link
Contributor

jphickey commented Jan 8, 2021

Actually, just assign this one to me. As I'm going through code looking for race conditions in issue #1073 the entire design of CFE_SB_ReadQueue() is broken - it is accessing PipeDscPtr without the SB lock. I will replace this with something that works.

@jphickey jphickey assigned jphickey and unassigned CDKnightNASA Jan 8, 2021
@skliper skliper added this to the 7.0.0 milestone Jan 8, 2021
@jphickey jphickey linked a pull request Jan 13, 2021 that will close this issue
@skliper skliper closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants