GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sea: keep ELF segments on separate pages in --build-sea output by codebytere · Pull Request #65564 · nodejs/node

Conversation

@codebytere

@codebytere codebytere commented Aug 26, 2026

Copy link
Copy Markdown
Member

The sea/* failures on the rhel8-x64 CI hosts (SIGSEGV, empty stderr, https://github.com/nodejs/reliability/blob/main/reports/2026-08-26.md) come with a kernel line, elf segment at ... requested but the memory is mapped already (nodejs/build#4433 (comment)), which is execve refusing the injected executable. When node is not PIE (RHEL toolchains, and the official Linux binaries), LIEF makes room for the new program header by moving the header table into the largest gap between two PT_LOAD segments and extending the earlier segment across it; when that gap is the one between the read-only data and the read-write segment, whose boundary is not page aligned, the extended segment ends inside the next segment's first page. Linux 4.17 to 5.3 and RHEL 8's 4.18 map an executable's segments with MAP_FIXED_NOREPLACE, so the second mapping fails past the point of no return and the process is killed; newer kernels don't check. Which gap is largest depends on section sizes, so it comes and goes from build to build.

This asks LIEF for its after-.bss placement when the executable is ET_EXEC, which leaves every existing segment where the linker put it and gives the header table pages of its own; the output grows by the size of .bss (about 340 KB for node). PIE builds are unchanged. postject makes the same choice in its own copy of LIEF, so test-single-executable-application.js and test_sea_addon, which still inject with it, aren't covered by this.

Tests:

  • new test/sea/test-build-sea-elf-segments.js asserts no two PT_LOAD segments of a --build-sea executable share a page; test/sea passes
  • reproduced off CI with a non-PIE node built with RHEL 8's clang whose read-only/read-write gap is the largest: on AlmaLinux 8.10 (4.18.0-553.150.1.el8_10) the SEA built before this change segfaults with the same kernel line and the one built after it runs; both run on a 6.12 kernel

Refs: nodejs/build#4433


Disclosure: the code, test, investigation and this description were written by Claude Code, directed and reviewed by @codebytere.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@codebytere
sea: keep ELF segments on separate pages in --build-sea output
84be637
When node itself is not position independent (the official Linux
binaries, and any build with a toolchain that does not default to PIE),
LIEF made room for the extra program header by moving the header table
into the largest gap between two PT_LOAD segments and extending the
earlier segment across that gap. Whenever the gap it picked was the one
between the read-only data and the read-write segment, whose boundary
is not page aligned, the extended segment ended inside the first page
of the next one. Linux 4.17 to 5.3, and RHEL 8's 4.18 kernel, map an
executable's segments with MAP_FIXED_NOREPLACE and refuse the second
mapping, so the single executable was killed with SIGSEGV before it ran
a single instruction ('elf segment at ... requested but the memory is
mapped already' in the kernel log). Which gap is largest depends on
section sizes, so roughly one build in three produced such binaries.

Ask LIEF to place the table after .bss for non-PIE executables instead,
which leaves every existing segment as the linker laid it out; the
output grows by the size of .bss. A test checks that no two PT_LOAD
segments of a --build-sea executable share a page.

Signed-off-by: Shelley Vohr <[email protected]>
@nodejs-github-bot

nodejs-github-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/single-executable
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications. labels Aug 26, 2026
panva
panva approved these changes Aug 26, 2026
View reviewed changes

@panva panva left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

RSLGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@panva panva added fast-track PRs proposed for a shorter-than-standard waiting period before landing. author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. review wanted PRs that need review. labels Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Fast-track has been requested by @panva. Please 👍 to approve.

panva, codebytere, MikeMcC399, sxa, nhjbest22, jasnell, and trivikr reacted with thumbs up emoji
All reactions
  • 👍 7 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva mentioned this pull request Aug 26, 2026
test: mark platform-specific tests as flaky #65562
Merged
@codebytere codebytere mentioned this pull request Aug 26, 2026
node-test-commit-linux on 'rhel8-x64' is failing since 2026-08-20 nodejs/build#4433
Closed
@MikeMcC399 MikeMcC399 mentioned this pull request Aug 26, 2026
permission: support URL and Uint8Array as has()/drop() reference #65492
Merged
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Aug 26, 2026
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@MikeMcC399 MikeMcC399 mentioned this pull request Aug 26, 2026
Single Executable Application tests often fail on RISC-V #61110
Open
@sxa

sxa commented Aug 26, 2026

Copy link
Copy Markdown
Member

That's not ideal - merge conflict on the rhel8-x64 machine
https://ci.nodejs.org/job/node-test-commit-linux/72453/nodes=rhel8-x64/console

Attempting a test in the stress job with 100 iterations: rhel8-x64 and rhel9-x64 as we really need the results on rhel8-x64 ASAP.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@codecov

codecov Bot commented Aug 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.06%. Comparing base (7b6b21a) to head (84be637).
⚠️ Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
src/node_sea_bin.cc 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #65564   +/-   ##
=======================================
  Coverage   90.05%   90.06%           
=======================================
  Files         751      751           
  Lines      254420   254423    +3     
  Branches    47975    47986   +11     
=======================================
+ Hits       229121   229148   +27     
+ Misses      16483    16444   -39     
- Partials     8816     8831   +15     
Files with missing lines Coverage Δ
src/node_sea_bin.cc 41.07% <0.00%> (-0.45%) ⬇️

... and 35 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva added the flaky-test Issues and PRs involving tests that fail intermittently in CI. label Aug 26, 2026
sxa
sxa approved these changes Aug 26, 2026
View reviewed changes

@sxa sxa left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Annoying (as usual...) but https://ci.nodejs.org/job/node-stress-single-test/nodes=rhel8-x64/848/console which was without this patch seemed to be passing too. But on the basis this has been tested in an environment where it was reproducible I'm approving.

Out of interest, did you manage to come to any conclusion abot what change could have caused this to start going wrong recently given that it doesn't seem to have been package updates?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

This comment has been minimized.

Sign in to view
@nodejs-github-bot

This comment was marked as resolved.

Sign in to view
@nodejs-github-bot

nodejs-github-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/76541/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sxa

sxa commented Aug 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Every so often we get a problem with merge/rebase conflicts and we don't have a permanent fix for it at the moment. This one seems to have triggered it. We've had 3 PR test runs so far and I'm collating these links for my own benefit and because I'm going to try and disable one machine to let this through:

test-pr job test-commit job Failures
76521 91260 do-rhel8-x64-1 (multiple merge conflicts) do-rhel9-x64-1 (Makefile conflict) ibm-rhel8-s390x-1 osu-rhel8c-arm64-1 aix73-power9
76529 91268 do-rhel9-x64-1 (multiple merge conflicts) rhel8-x64 passed on do-rhel8-x64-2 ibm-aix-72-2 l1cc-rhel9-s390x-2
76538 71277 ibm-rhel8-x64-3 (Multiple merge conflicts) do-rhel9-x64-1 (Multiple merge conflicts) do-f42-x64-1 ibm-rhel8-s390x-3 (Makefile conflict) ibm-aix72-2

A few notes:

  • rhel8-s390x tests are all failures with parallel/test-http2-debug so assumed unrelated to this PR
  • the third PR test row above is not just a re-run of the failures in the second row - it re-run most of the platforms from what I can see including ones that passed so it has re-run rhel8-x64 which failed, but it had already passed in the second one.
  • The rhel9-x64 merge conflicts is still a problem. All three ran on the same machine which I've now taken offline so the next run will be forced to one of the other two and run a retry of the second job. It's running as per the comment that has just been posted above and the rhel9-x64 job is now executing without merge conflicts - on test-ibm-rhel9-x64-2

Hopefully that new run will get close to a pass although I'll note that between the second and third runs we do have passes on both rhel8-s390x and rhel9-s390x. Similarly for AIX we have passes on both aix72-power9 and aix73-power9](https://ci.nodejs.org/job/node-test-commit-aix/64731/) I'll keep the problematic rhel9/x64 machine offline and perhaps see if I can analyse the workspace on the machine to try and replicate the problem manually. Mentioning nodejs/build#4345 which was a similar situation seen in the past.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/76542/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Aug 27, 2026
View reviewed changes
@nodejs-github-bot

nodejs-github-bot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/76549/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva added the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 27, 2026
@nodejs-github-bot
nodejs-github-bot merged commit a2bbe4e into nodejs:main Aug 27, 2026
97 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Landed in a2bbe4e

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Aug 27, 2026
This was referenced Aug 27, 2026
Built-In Node has low disk space nodejs/build#4419
Closed
Merge conflicts on node-test-commit-* jobs nodejs/build#4445
Closed
@panva panva mentioned this pull request Aug 28, 2026
crypto: add a generic MAC API #65553
Closed
aduh95 pushed a commit that referenced this pull request Aug 29, 2026
@codebytere @aduh95
sea: keep ELF segments on separate pages in --build-sea output
cfe352d
When node itself is not position independent (the official Linux
binaries, and any build with a toolchain that does not default to PIE),
LIEF made room for the extra program header by moving the header table
into the largest gap between two PT_LOAD segments and extending the
earlier segment across that gap. Whenever the gap it picked was the one
between the read-only data and the read-write segment, whose boundary
is not page aligned, the extended segment ended inside the first page
of the next one. Linux 4.17 to 5.3, and RHEL 8's 4.18 kernel, map an
executable's segments with MAP_FIXED_NOREPLACE and refuse the second
mapping, so the single executable was killed with SIGSEGV before it ran
a single instruction ('elf segment at ... requested but the memory is
mapped already' in the kernel log). Which gap is largest depends on
section sizes, so roughly one build in three produced such binaries.

Ask LIEF to place the table after .bss for non-PIE executables instead,
which leaves every existing segment as the linker laid it out; the
output grows by the size of .bss. A test checks that no two PT_LOAD
segments of a --build-sea executable share a page.

Signed-off-by: Shelley Vohr <[email protected]>
PR-URL: #65564
Refs: nodejs/build#4433
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Stewart X Addison <[email protected]>
Reviewed-By: James M Snell <[email protected]>
aduh95 pushed a commit that referenced this pull request Sep 3, 2026
@codebytere @aduh95
sea: keep ELF segments on separate pages in --build-sea output
aeb78a5
When node itself is not position independent (the official Linux
binaries, and any build with a toolchain that does not default to PIE),
LIEF made room for the extra program header by moving the header table
into the largest gap between two PT_LOAD segments and extending the
earlier segment across that gap. Whenever the gap it picked was the one
between the read-only data and the read-write segment, whose boundary
is not page aligned, the extended segment ended inside the first page
of the next one. Linux 4.17 to 5.3, and RHEL 8's 4.18 kernel, map an
executable's segments with MAP_FIXED_NOREPLACE and refuse the second
mapping, so the single executable was killed with SIGSEGV before it ran
a single instruction ('elf segment at ... requested but the memory is
mapped already' in the kernel log). Which gap is largest depends on
section sizes, so roughly one build in three produced such binaries.

Ask LIEF to place the table after .bss for non-PIE executables instead,
which leaves every existing segment as the linker laid it out; the
output grows by the size of .bss. A test checks that no two PT_LOAD
segments of a --build-sea executable share a page.

Signed-off-by: Shelley Vohr <[email protected]>
PR-URL: #65564
Refs: nodejs/build#4433
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Stewart X Addison <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@github-actions github-actions Bot mentioned this pull request Sep 7, 2026
Version 26.9.0 (Current) #65881
Merged
aduh95 pushed a commit that referenced this pull request Sep 15, 2026
@codebytere @aduh95
sea: keep ELF segments on separate pages in --build-sea output
0ec15a2
When node itself is not position independent (the official Linux
binaries, and any build with a toolchain that does not default to PIE),
LIEF made room for the extra program header by moving the header table
into the largest gap between two PT_LOAD segments and extending the
earlier segment across that gap. Whenever the gap it picked was the one
between the read-only data and the read-write segment, whose boundary
is not page aligned, the extended segment ended inside the first page
of the next one. Linux 4.17 to 5.3, and RHEL 8's 4.18 kernel, map an
executable's segments with MAP_FIXED_NOREPLACE and refuse the second
mapping, so the single executable was killed with SIGSEGV before it ran
a single instruction ('elf segment at ... requested but the memory is
mapped already' in the kernel log). Which gap is largest depends on
section sizes, so roughly one build in three produced such binaries.

Ask LIEF to place the table after .bss for non-PIE executables instead,
which leaves every existing segment as the linker laid it out; the
output grows by the size of .bss. A test checks that no two PT_LOAD
segments of a --build-sea executable share a page.

Signed-off-by: Shelley Vohr <[email protected]>
PR-URL: #65564
Refs: nodejs/build#4433
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Stewart X Addison <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@Project516 Project516 mentioned this pull request Oct 22, 2026
fix(build): restore ARM64 CLI support on larger-page kernels pingdotgg/t3code#23443
Closed
This was referenced Oct 27, 2026
sea: --build-sea linux-arm64 output fails on 16 KiB and 64 KiB page kernels #67048
Open
[Bug]: linux-arm64 CLI from nightly 20261022.3512 cannot exec on 16 KiB-page kernels (Raspberry Pi 5) pingdotgg/t3code#23433
Closed
fix(build): TEMPORARY workaround so linux-arm64 builds run on 16/64 KiB page kernels pingdotgg/t3code#25825
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@panva panva panva approved these changes
@jasnell jasnell jasnell approved these changes
@sxa sxa sxa approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. fast-track PRs proposed for a shorter-than-standard waiting period before landing. flaky-test Issues and PRs involving tests that fail intermittently in CI. needs-ci PRs that need a full CI run. review wanted PRs that need review. single-executable Issues and PRs related to single-executable applications.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@codebytere @nodejs-github-bot @sxa @panva @jasnell
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.