Re-enable Hical after fixing TCP fragmentation chunked-decode bug - #1431
Merged
Conversation
Hical was disabled in MDA2AV#1289 after failing the exhaustive TCP fragmentation check (MDA2AV#1285): ~9% of split offsets on chunked POST requests were answered 400 Bad Request. Root cause: the chunked-body decoder tracked its position with an encodeStart offset and advanced it by phr_decode_chunked's *output* byte count, treating output length as consumption. When a chunk frame was split across TCP reads at a point inside the frame, the offset drifted and the decoder misreported a malformed-encoding error. This is the 'narrow slice' class of defect from MDA2AV#1289, not a parser that cannot reassemble. Fixed upstream in Hical61/Hical commit a5abb27, which drops the manual offset tracking and re-decodes unconsumed data from the front each pass, relying on phr_decode_chunked's decoder state machine across recv() calls. Three fragmentation regression tests were added. This PR: - re-enables the entry (enabled: false -> true) - pins HICAL_REF to a5abb27c59e604a5fe15dfde49c634de5a13efce Please re-run the benchmark and the exhaustive fragmentation validation.
Hical61
requested review from
Kaliumhexacyanoferrat and
MDA2AV
as code owners
September 3, 2026 03:58
Collaborator
|
Validation passed, so this worked 🙂 /benchmark -f hical --save |
Contributor
|
👋 Benchmark request received. A collaborator will review and approve the run. |
Contributor
Benchmark ResultsFramework: No results captured Full log |
Contributor
Author
|
@Kaliumhexacyanoferrat Could you please run CI again |
Owner
|
/benchmark -f hical --save |
Contributor
|
👋 Benchmark request received. A collaborator will review and approve the run. |
Contributor
Benchmark ResultsFramework:
Full log |
MDA2AV
approved these changes
Sep 3, 2026
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.
Background
Hical was disabled (
enabled: false) and its results dropped in #1289 after failing the exhaustive TCP fragmentation check in #1285 — about 9% of split offsets across nine request shapes returned 400.Root cause
Hical uses picohttpparser for zero-copy header parsing and a custom chunked-body decoder. The old decoder tracked its position with an
encodeStartoffset and advanced it byphr_decode_chunked's output byte count (encodeStart += decodeBufLen), treating output length as consumption. When a chunk frame arrived split across multiple TCP reads — with the split point inside the frame (mid chunk-size hex, between CR/LF, etc.) — the offset drifted and the decoder misreported a malformed-encoding error, answering 400.Per the #1289 commit message, this is the "narrow slice" class of defect: an edge case at specific split points, not a parser that cannot reassemble at all.
Fix
Fixed upstream in Hical61/Hical commit a5abb27c59e604a5fe15dfde49c634de5a13efce: the manual offset tracking was removed in favor of re-decoding unconsumed data from the front on each pass, relying on
phr_decode_chunked's decoder state machine to carry progress acrossrecv()calls. Three fragmentation regression tests were added (ChunkedRequestBodyFragmented,ChunkedRequestBodySplitEveryByte,ChunkedRequestWithPipelinedTail), withChunkedRequestBodySplitEveryBytemirroring this exhaustive split sweep.Changes
frameworks/hical/meta.json:enabled: false→enabled: trueframeworks/hical/Dockerfile:HICAL_REF→a5abb27c59e604a5fe15dfde49c634de5a13efceVerification
Locally reproduced the full post-fix request path (header parsing +
phr_decode_chunked+ pipeline tail write-back) in C and exhaustively verified all ninevalidate-frag.pyrequest shapes at every byte offset (1,107 split points total) — zero failures, no remaining split-boundary issues.Please re-run the benchmark and the exhaustive fragmentation validation.