Skip to content

Conversation

@Renegade334
Copy link
Member

Fixes: #61025
Refs: #60497

The range checks for bound SharedArrayBuffer construction weren't compatible with the maximum array buffer size on 32-bit architectures.

@nodejs-github-botnodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Dec 11, 2025
@Renegade334Renegade334 added dont-land-on-v20.x PRs that should not land on the v20.x-staging branch and should not be released in v20.x. dont-land-on-v22.x PRs that should not land on the v22.x-staging branch and should not be released in v22.x. labels Dec 11, 2025
@codecov
Copy link

codecovbot commented Dec 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.53%. Comparing base (79df8b2) to head (0b36af9).
⚠️ Report is 30 commits behind head on main.

Additional details and impacted files
@@ Coverage Diff @@## main #61026 +/- ## ========================================== - Coverage 88.55% 88.53% -0.02%  ========================================== Files 703 703 Lines 208522 208522 Branches 40219 40205 -14 ========================================== - Hits 184647 184609 -38 - Misses 15905 15919 +14 - Partials 7970 7994 +24 

see 41 files with indirect coverage changes

🚀 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.

// Specifically test the following cases:
// - out-of-range allocation requests should not crash the process
// - no int64 overflow
for(constlengthof[-1,kMaxLength+1,2**64]){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to keep Number.MAX_SAFE_INTEGER + 1 test case?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intention behind Number.MAX_SAFE_INTEGER was that this is the maximum array buffer size on 64-bit builds, so that particular test value lives on as kMaxLength + 1.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's still interesting to test with an "unsafe" integer

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's kinda covered by 2^64, but can add this if preferred

Copy link
Contributor

@aduh95aduh95Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it had to be one or the other, I would pick Number.MAX_SAFE_INTEGER + 1 over 2 ** 64, that seems more interesting / intent revelling to me. I don't feel strongly either way, so non-blocking comment

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The significance of 2^64 is that the size is passed via an int64_t intermediate, so has potential to overflow if not correctly clamped. It's a little academic, I can't imagine any of our internals will be allocating terabytes of shared memory 😀

@aduh95aduh95 added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 16, 2025
@github-actionsgithub-actionsbot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 19, 2025
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@aduh95aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 20, 2025
@nodejs-github-botnodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Dec 20, 2025
@nodejs-github-botnodejs-github-bot merged commit ed6ec96 into nodejs:mainDec 20, 2025
87 checks passed
@nodejs-github-bot
Copy link
Collaborator

Landed in ed6ec96

@Renegade334Renegade334 deleted the test-sab-dynamic-oob-sizes branch December 20, 2025 23:16
MatricalDefunkt pushed a commit to MatricalDefunkt/node that referenced this pull request Dec 22, 2025
aduh95 pushed a commit that referenced this pull request Jan 9, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.dont-land-on-v20.xPRs that should not land on the v20.x-staging branch and should not be released in v20.x.dont-land-on-v22.xPRs that should not land on the v22.x-staging branch and should not be released in v22.x.needs-ciPRs that need a full CI run.testIssues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure on 32-bit architectures

3 participants

@Renegade334@nodejs-github-bot@aduh95