Skip to content

[cherry-pick] build: clamp PT_LOAD p_align to 4 KiB on linux-x64 node binary#319407

Merged
deepak1556 merged 1 commit into
release/1.123from
cherry-pick/319355
Jun 2, 2026
Merged

[cherry-pick] build: clamp PT_LOAD p_align to 4 KiB on linux-x64 node binary#319407
deepak1556 merged 1 commit into
release/1.123from
cherry-pick/319355

Conversation

@vs-code-engineering
Copy link
Copy Markdown
Contributor

Cherry-pick of #319355 from main.

Node.js 23/24 linux x64 build ships a dedicated lpstub PT_LOAD segment aligned to 2 MiB (0x200000) so that, at startup the binary can remap its .text region onto Linux hugepages for an iTLB win --use-largepages=mode.

WSL1 binfmt_elf strictly rejects any PT_LOAD whose p_align exceeds the system page size (0x1000); the kernel returns ENOEXEC before user space ever runs. This breaks launching the bundled Node from the VS Code server under WSL1 starting with Node 24.

The fix does not change runtime behavior:

  • Node is a non-PIE EXEC binary with fixed virtual addresses (p_vaddr, p_paddr); the loader maps each PT_LOAD at its hard-coded address regardless of p_align, which on EXEC is metadata describing alignment in memory rather than a request to relocate.
  • No shared libraries, native addons, or dynamic linker paths are touched — only PT_LOAD segments inside the node executable itself.

Fixes #318494

Copilot AI review requested due to automatic review settings June 1, 2026 17:39
@vs-code-engineering vs-code-engineering Bot added the cherry-pick-artifact Auto-generated cherry-pick PR label Jun 1, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@vs-code-engineering
Copy link
Copy Markdown
Contributor Author

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@dmitrivMS

Matched files:

  • test/sanity/src/context.ts
  • test/sanity/src/wsl.test.ts

@deepak1556 deepak1556 added this to the 1.123.0 milestone Jun 2, 2026
@deepak1556 deepak1556 enabled auto-merge (squash) June 2, 2026 00:19
@deepak1556 deepak1556 merged commit 5327c02 into release/1.123 Jun 2, 2026
25 checks passed
@deepak1556 deepak1556 deleted the cherry-pick/319355 branch June 2, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick-artifact Auto-generated cherry-pick PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants