-
Notifications
You must be signed in to change notification settings - Fork 207
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 test to cfe_testcase app demonstrating non-detection of pipe destruction by CFE_SB_ReceiveBuffer #1777
base: main
Are you sure you want to change the base?
Conversation
…estruction by CFE_SB_ReceiveBuffer
2c6de53
to
a4e23ca
Compare
@astrogeco Thanks for taking a look. I opened an #1799 which related this test case to the extant one you referenced. My main question is what is the expected behavior of a blocking call to |
At this point that behavior is undefined :) Haven't had a chance to look into it, but it may be challenging to provide a defined behavior based in the differing underlying implementations (message queues, etc). My suggestion from a user standpoint would be to avoid the undefined behavior by providing a "shutdown" message or similar which would then be consistent/more portable. I haven't dug into the design... but you can also use the child task management APIs if the intent is to stop the child task or similar. |
@skliper thanks for the note. I definitely appreciate the challenge in making this work reliably across platforms. My go-to for avoiding these sort of issues is to just never use indefinitely-blocking calls. In our SBN fork we've just replaced this call with a 1000ms timeout. Maybe SB could push a sentinel message into the pipe before destroying it, which would produce an appropriately descriptive error code on any blocking listeners. This might still require some additional bookkeeping, but I also haven't dug into what's already there. |
…DeletePipe() See discussion in nasa#1777
Good approach!
Good suggestion! Definitely worth consideration. I'm not sure how much analysis was done relative to multiple tasks sharing/using/managing a single pipe and ensuring consistent/guaranteed behavior in those scenarios. |
|
Describe the contribution
A clear and concise description of what the contribution is.
cfe_testcase
app demonstrating a potential bug inCFE_SB_ReceiveBuffer()
CFE_SB_ReceiveBuffer()
is called withCFE_SB_PEND_FOREVER
, and its pipe is destroyed, it does not return with an error code. (It is unclear at this time whether it blocks indefinitely or returns withCFE_SUCCESS
).CFE_SB_ReceiveBuffer()
Testing performed
Steps taken to test the contribution:
sample_defs
cfe_testcase
toMISSION_GLOBAL_APPLIST
intargets.cmake
:list(APPEND MISSION_GLOBAL_APPLIST sample_app sample_lib cfe_testcase)
cfe_testcase
tocpu1_cfe_es_startup.scr
:CFE_APP, cfe_testcase, CFE_TestMain, TESTCASE_APP, 50, 16384, 0x0, 0;
./core-cpu1
out of standard build directoryExpected behavior changes
The test case does the following:
Output from the failing check:
This indicates that 1.0 seconds after deleting an SB pipe, a call to
CFE_SB_ReceiveBuffer()
has not exited with a failure condition.System(s) tested on
Development Build: 6.8.0-rc1+dev290
Development Build: v5.1.0-rc1+dev586
Development Build: v1.5.0-rc1+dev118
Additional context
We've been working with an internal fork of SBN running with cFE (version
Development Build: 6.8.0-rc1+dev290
) and encountered a race condition where a blocking call toCFE_SB_ReceiveBuffer()
is not failing if its SB pipe is destroyed while waiting. This is modeled after the implementation in SBN [ref].cc @CDKnightNASA
Third party code
No third-party code is included.
Contributor Info - All information REQUIRED for consideration of pull request
Full name and company/organization/center of all contributors ("Personal" if individual work)