Skip to content

fix(qlog): list a hidden stream's records without spreading call arguments - #2860

Merged
morluto merged 6 commits into
morluto:mainfrom
Dragolone:fix/qlog-incomplete-stream-spread
Oct 13, 2026
Merged

morluto merged 6 commits into
morluto:mainfrom
Dragolone:fix/qlog-incomplete-stream-spread

Conversation

@Dragolone

Copy link
Copy Markdown
Contributor

Summary

When an explicit sensitive value matches a qlog stream's derived total, the decoder omits the stream and lists its contributing records as incomplete. It did this with incomplete_fact_records.push(...stream.contributions.map(...)). A stream with more contributions than the engine's call-argument limit (about 125k on Node 24) makes that spread throw RangeError: Maximum call stack size exceeded. A valid capture within the input budget then fails instead of being reported with incomplete records.

This is the same class as #1538/#1539. No issue is linked: I searched issues and PRs for "qlog", "Maximum call stack" and "RangeError" and found no qlog report.

Problem and expected behavior

Smallest trigger: 130,000 one-byte STREAM frames on stream 0, packed 1,000 per transport:packet_sent event (130 events), decoded with the sensitive value "130000", which matches the stream's derived unique_bytes / frame_length_sum.

  • Before: RangeError: Maximum call stack size exceeded. In the CLI/MCP path, the decoder process reports this as an unexpected decoder failure.
  • Expected and after: streams: [] and incomplete_fact_records = ordinals 0–129.

Reaching this needs several STREAM frames per event. aioquic usually logs one frame per packet, and in that layout the decoder heap limit is reached first, which is the documented resource constraint. So this is uncommon producer output, but it is accepted by the profile and stays within the input budget.

Change and scope

The ordinals are pushed in a for … of loop instead of a spread call. Nothing else changes; the existing de-duplication of incomplete_fact_records is untouched.

Contribution scope: an ordinary decoder robustness fix within existing boundaries; a maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: stream summarization in decodeQlogCapture, src/browser/history/QlogCapture.ts.
  • Contribution scope fit and linked maintainer decision: in scope; not applicable.
  • CLI and MCP/tool-catalog contract: none; a capture that crashed now returns its documented result.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: none beyond the above.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): not applicable.
  • Generated metadata (docs/public/product-catalog.json), package, or installation impact: none.

Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: src/browser/history/QlogCapture.test.ts — "omits a hidden derived total for a stream with more contributions than call arguments allow" (about 0.7 s).
  • Base reproduction: on 94072364c the new test fails with RangeError: Maximum call stack size exceeded.
  • User-visible CLI/MCP output: not separately captured; the qlog acceptance suite (built CLI and stdio MCP) passes.
  • Remaining proof gaps: I did not rerun the case under the decoder's production heap flags in this PR's validation.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

macOS (Apple silicon), Node 24.19.0.

  • npx vitest run src/browser/history/QlogCapture.test.ts -t "call arguments" on the base — fails with the RangeError above.
  • npx vitest run src/browser/history/ with the fix — 5 files, 100 tests passed.
  • npm run build:cached && npx vitest run tests/acceptance/tools/qlogCapture.test.ts — 4 passed, 1 skipped.
  • npm run typecheck — passed.
  • npx oxfmt --check and npx oxlint on both changed files — passed, no errors.
  • npm run verify:module-boundaries — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none; no hidden value is projected.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

…ments

When an explicit declaration matched a stream's derived total, the
decoder pushed every contribution ordinal with a spread call. A stream
with more than ~125k STREAM frames exceeded the engine's argument limit,
so a valid capture within the input budget failed with RangeError
instead of listing the records as incomplete. Push the ordinals in a
loop.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] This PR appears safe to merge; the loop avoids the argument-limit failure without changing which streams or record ordinals are returned.

Summary

Replaces argument spreading with individual pushes when a qlog stream must be hidden.

  • Hidden qlog streams with many records still return their incomplete record list.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into fix/qlog-incomp..." · Reviewed by Greptile

dakjdakd and others added 5 commits October 14, 2026 00:57
* fix(comparison): preserve incomplete function call evidence

Keep missing, unknown, partial and unresolved call relationships unknown in function comparisons and reconstruction claims. Aggregate IDA caller and callee coverage without overwriting uncertainty.

Validate with 144 focused tests, typecheck/lint, docs checks and test discovery. Real providers were not verified; the full headless IDA session suite requires unavailable Windows native controls.

* fix(comparison): recheck historical calls-only changes

---------

Co-authored-by: morluto <76467478+morluto@users.noreply.github.com>
@morluto
morluto merged commit 39f96d7 into morluto:main Oct 13, 2026
29 checks passed
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto

morluto commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Thanks for #2860, @Dragolone. Replacing the large spread with an iterative push keeps a valid qlog capture from crashing when a hidden stream has many contributing records, and the regression pins the full set of incomplete record ordinals. Great catch on this scale edge case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants