Repository navigation
Fix process crash on empty or non-string packet in HTTP onPacketReadySerializeImpl - #4715
Open
gaurav-singh2525 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the HTTP packet-serialization safeguards.
No open issues 🎉
What changed in this PR
Addresses #4714 by guarding HTTP MediaPipe packet serialization against empty and non-string payloads, preventing fatal assertions during string extraction.
Changes:
- Clears the response and returns success for empty packets.
- Logs type mismatches and returns
MEDIAPIPE_EXECUTION_ERRORfor non-string packets. - Adds unit tests covering valid strings, empty packets, and incompatible payload types.
| File | Description |
|---|---|
src/test/mediapipeflow_test.cpp |
Adds three tests for HTTP packet serialization behavior. |
src/http_frontend/http_graph_executor_impl.cpp |
Validates packets before string extraction and adds diagnostic logging. |
Review effort: Balanced
gaurav-singh2525
force-pushed
the
fix-http-mediapipe-packet-serialization
branch
from
October 30, 2026 17:59
c243d47 to
8b0ad84
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 Summary
Issue: Fixes #4714
Problem
In
src/http_frontend/http_graph_executor_impl.cpp,onPacketReadySerializeImpl()calledpacket.Get<std::string>()directly without checking!packet.IsEmpty()or validating the stored type. This triggered MediaPipe's internalABSL_CHECKassertions, resulting in a fatalSIGABRTcrash on empty or non-string packets.Solution
packet.IsEmpty()validation: Safely clears the response and returnsStatusCode::OKwhen empty/control packets arrive.packet.ValidateAsType<std::string>().ok()validation: Safely returnsStatusCode::MEDIAPIPE_EXECUTION_ERRORon type mismatch instead of triggering an uncatchable assertion abort.#include "../logging.hpp": Provides proper debug and error logging when invalid packets are received.HttpMediapipeSerializationtest suite insrc/test/mediapipeflow_test.cppverifying valid string extraction, empty packet handling, and error handling on incompatible types🧪 Checklist