Skip to content

sea: exit cleanly when fuse set without NODE_SEA_BLOB - #65211

Open
sankalpsthakur wants to merge 1 commit into
nodejs:mainfrom
sankalpsthakur:fix/63466-sea-missing-blob
Open

sea: exit cleanly when fuse set without NODE_SEA_BLOB#65211
sankalpsthakur wants to merge 1 commit into
nodejs:mainfrom
sankalpsthakur:fix/63466-sea-missing-blob

Conversation

@sankalpsthakur

Copy link
Copy Markdown

Summary

When the SEA fuse byte is set but postject_find_resource("NODE_SEA_BLOB") returns null (or an empty size), FindSingleExecutableBlob previously passed a null pointer into BlobDeserializer, which SIGSEGVed in ReadArithmetic via memcpy.

This adds a null/empty-size guard that prints a clear diagnostic and exits with ExitCode::kGenericUserError instead.

This failure mode shows up when postject flips the fuse but fails to inject a resource (for example host binaries missing a PT_NOTE program header). See also nodejs/postject#107 and nodejs/unofficial-builds#200.

Validation

  • Reproduced the fuse-set / missing-blob failure mode with the official v26.1.0 darwin-arm64 binary (fuse sentinel present; mutating fuse alone triggers the broken path).
  • Local Homebrew Node lacks SEA (single_executable_application=false), so a full rebuilt binary was not available here; CI will compile and run test/sea/test-single-executable-application-missing-blob.js.
  • Added a SEA regression test that copies process.execPath, flips the fuse to 1 without injecting a blob, and asserts exit status 1 with the new error message (no crash signal).

Fixes #63466

AI/LLM disclosure

  • AI coding tools (including Grok and/or Codex agent-assisted editing) were used to help draft or modify code and this PR description.
  • I reviewed the complete change, understand the reasoning, and ran the reported local tests before submitting.
  • This submission is original work of authorship under the project CLA / contributor terms; AI output was not pasted unreviewed.

Made with Cursor

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/single-executable

@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 11, 2026
When the postject fuse byte is set but NODE_SEA_BLOB cannot be found,
FindSingleExecutableBlob previously constructed a null string_view and
BlobDeserializer NULL-dereferenced. Exit with a clear error instead.

Fixes: nodejs#63466
Signed-off-by: Sankalp Thakur <sankalphimself@gmail.com>
@sankalpsthakur
sankalpsthakur force-pushed the fix/63466-sea-missing-blob branch from 8fcfaaa to 5334e50 Compare August 11, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. single-executable Issues and PRs related to single-executable applications

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SEA: BlobDeserializer SIGSEGVs when fuse byte is set but no NODE_SEA_BLOB is present

2 participants