Skip to content

bridge: parse comma messages from an aligned copy and skip malformed ones - #285

Open
ehoeve786 wants to merge 1 commit into
softwiredtech:mainfrom
ehoeve786:fix/comma-capnp-parse-safety
Open

ehoeve786 wants to merge 1 commit into
softwiredtech:mainfrom
ehoeve786:fix/comma-capnp-parse-safety

Conversation

@ehoeve786

Copy link
Copy Markdown
Collaborator

processMessage built a capnp FlatArrayMessageReader directly on the raw msgq/zmq buffer, with no alignment copy (openpilot uses AlignedBuffer for this) and no exception handling. A truncated, misaligned or non-capnp message on the subscribed port threw a kj::Exception out of the receive loop and terminated the app. Copy into a reusable 8-byte-aligned buffer, and log and skip a message that fails to parse.

Testing

  • Android builds and the unit tests pass.
  • Not run on a device: this path needs a comma device on the same network, which my setup doesn't have connected.

🤖 Generated with Claude Code

…ones

processMessage built a capnp FlatArrayMessageReader directly on the raw
msgq/zmq buffer, with no alignment copy (openpilot uses AlignedBuffer for
this) and no exception handling. A truncated, misaligned or non-capnp
message on the subscribed port threw a kj::Exception out of the receive loop
and terminated the app. Copy into a reusable 8-byte-aligned buffer, and log
and skip a message that fails to parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant