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

In FprimeProtocol.cpp:deframe(), make buffer no larger than requested… #822

Merged
merged 1 commit into from
Jul 14, 2021

Conversation

nabcouwer
Copy link
Contributor

Originating Project/Creator JPL COLDArm / Neil Abcouwer
Affected Component FramingProtocol
Affected Architectures(s) n/a
Related Issue(s) n/a
Has Unit Tests (y/n) y (no change to unit tests for this change, but unit tests still run successfully)
Builds Without Errors (y/n) y
Unit Tests Pass (y/n) y
Documentation Included (y/n) n

Change Description

When Svc/FramingProtocol/FprimeProtocol.cpp:deframe() calls m_interface->allocate(), set the size of the returned buffer to be the requested size.

Rationale

When Svc/FramingProtocol/FprimeProtocol.cpp:deframe() calls m_interface->allocate(), some allocators (StaticMemory) can return buffers that are larger than requested. In the case of uplink deframing, this size disparity makes it so commands can't be deframed successfully.

Alternatively, if returning a larger buffer than requested is bad, StaticMemory component could be changed instead. But should probably make allocation requests robust to bigger buffers due to alignment issues, etc.

Testing/Review Recommendations

Worked properly in our deployment with a deframer and static memory component, but wouldn't have an effect on Reference deployment.

Future Work

None

… (as is possible with static memory allocator)
Copy link
Collaborator

@LeStarch LeStarch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@LeStarch LeStarch merged commit a56ca7c into nasa:devel Jul 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants