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-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Dec 11, 2025
@Renegade334 Renegade334 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

codecov bot 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 10 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 (const length of [-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
Member Author

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
Member Author

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

@aduh95 aduh95 Dec 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
Member Author

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 😀

@aduh95 aduh95 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. 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. needs-ci PRs that need a full CI run. request-ci Add this label to start a Jenkins CI on a PR. test Issues 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