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

Default configuration does not permit max-size SB message buffer to be allocated #1807

Closed
jphickey opened this issue Aug 13, 2021 · 0 comments · Fixed by #1809 or #1839
Closed

Default configuration does not permit max-size SB message buffer to be allocated #1807

jphickey opened this issue Aug 13, 2021 · 0 comments · Fixed by #1809 or #1839
Assignees
Labels
Milestone

Comments

@jphickey
Copy link
Contributor

Describe the bug
All messages need to be wrapped in a software bus message descriptor while in transit, and the software bus should be capable of accepting + passing messages up to CFE_MISSION_SB_MAX_SB_MSG_SIZE (configurable).

However, the default pool configuration does not allow this. Calling CFE_SB_AllocateMessageBuffer(CFE_MISSION_SB_MAX_SB_MSG_SIZE) retuns NULL due to this.

To Reproduce
Build with default configuration, and call CFE_SB_AllocateMessageBuffer(CFE_MISSION_SB_MAX_SB_MSG_SIZE) - returns NULL.

Expected behavior
Should return non-NULL, as CFE_MISSION_SB_MAX_SB_MSG_SIZE is the upper limit that should be acceptable.

System observed on:
Ubuntu

Additional context
This is because in the default SB pool configuration, there is not enough extra space in the maximum size pool block. It is defined here:

#define CFE_PLATFORM_SB_MAX_BLOCK_SIZE (CFE_MISSION_SB_MAX_SB_MSG_SIZE + 40)

The hardcoded "+ 40" bytes is not quite enough for the descriptor on a 64-bit CPU (it might work on 32-bit, did not test)

Reporter Info
Joseph Hickey, Vantage Systems, Inc.

@jphickey jphickey self-assigned this Aug 13, 2021
@jphickey jphickey added the bug label Aug 13, 2021
@skliper skliper added this to the 7.0.0 milestone Aug 13, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Aug 13, 2021
In the default config, the maximum bucket size for the SB pool was not
quite big enough to allocate a message of CFE_MISSION_SB_MAX_SB_MSG_SIZE
astrogeco added a commit that referenced this issue Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants