Skip to content

Validate the record size in ART trace files - #6333

Open
canova wants to merge 1 commit into
firefox-devtools:mainfrom
canova:push-xqwpsxspnotq
Open

canova wants to merge 1 commit into
firefox-devtools:mainfrom
canova:push-xqwpsxspnotq

Conversation

@canova

@canova canova commented Sep 18, 2026

Copy link
Copy Markdown
Member

Main | Deploy preview

For version 3 traces, recordSize is read from the file and used to advance the reader without any check. A record size of 0 makes the record loops in both the regular and streaming parsers never reach EOF, so the parser keeps appending the same record until it runs out of memory. A 73-byte file is enough to trigger this.

Reject record sizes smaller than the minimum 10 bytes when reading the header, and reject records whose fields need more bytes than the record size allows, which covers the 14-byte dual clock case.

For version 3 traces, recordSize is read from the file and used to
advance the reader without any check. A record size of 0 makes the
record loops in both the regular and streaming parsers never reach EOF,
so the parser keeps appending the same record until it runs out of
memory. A 73-byte file is enough to trigger this.

Reject record sizes smaller than the minimum 10 bytes when reading the
header, and reject records whose fields need more bytes than the record
size allows, which covers the 14-byte dual clock case.
@canova
canova requested a review from mstange September 18, 2026 16:18
@codecov

codecov Bot commented Sep 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.03%. Comparing base (a99dca0) to head (829677e).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
src/profile-logic/import/art-trace.ts 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6333      +/-   ##
==========================================
+ Coverage   83.92%   84.03%   +0.11%     
==========================================
  Files         353      354       +1     
  Lines       37969    38107     +138     
  Branches    10604    10765     +161     
==========================================
+ Hits        31865    32023     +158     
+ Misses       5675     5656      -19     
+ Partials      429      428       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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