Repository navigation
SEA created following Node.js documentation doesn't work #76
Description
Activity
Regarding the macOS issue, could you try running
codesign --sign - helloand then try again? I think it segfaults because the binary isn't signed anymore after postject processes it and having executables signed is a hard requirement on arm64.Regarding the macOS issue, could you try running codesign --sign - hello and then try again?
That works! I think it should be documented somewhere.
Reacted by Darshan Sen and Victor Nogueira- added a commit that references this issue
on Feb 22, 2023 Done - nodejs/node#46764!
I'm able to reproduce the Linux issue. Just wondering why we weren't able to catch this when the change was in a PR state. @targos do we use some non-default configure flags to build Node.js for official releases? Also, what compiler did we use for the release?
Based on https://ci-release.nodejs.org/job/iojs+release/9167/nodes=rhel8-x64-release/consoleFull
System: RHEL 8.7
Compiler: gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-16)
Configure:python3 ./configure \ --prefix=/ \ --dest-cpu=x64 \ --tag= \ --release-urlbase=https://nodejs.org/download/release/ \ --download-path=/home/iojs/node-icu/ --verbose --download=all --with-intl=full-icuCompile:
make install DESTDIR=node-v19.7.0-linux-x64 V=0 PORTABLE=1 make -C out BUILDTYPE=Release V=0Edit: found the release build for 19.7.0
Reacted by Darshan Sen and Tony Gorez@targos I wasn't able to repro this locally when I built node using the same options on an x64 ubuntu. Maybe this has something to do with the compiler / system where the build took place. GDB tells me that the crash took place somewhere inside:
0x0000000000c7df55 in (anonymous namespace)::GetSingleExecutableCode(v8::FunctionCallbackInfo<v8::Value> const&) ()This is the topmost frame in the stack trace, so I would need some more info.
(I have a hunch that this crash source is the same as #70 but I don't have a way to confirm without having access to the system.)
I'll open an issue asking for access in the build repo - nodejs/build#3207.
- added 2 commits that reference this issue
on Feb 26, 2023 I've confirmed that #77 fixes the issue.
- added a commit that references this issue
on Mar 3, 2023 - added 4 commits that reference this issue
on Mar 13, 2023 I confirm that the binary created with postject@1.0.0-alpha.5 and Node.js 19.8.1 works.
There are still warnings printed, though:
$ npx postject@latest hello NODE_JS_CODE hello.js \ --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 Start injection of NODE_JS_CODE in hello... warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' warning: Can't find string offset for section name '.note.100' 💉 Injection done!- added a commit that references this issue
on Apr 11, 2023 - added a commit that references this issue
on Nov 10, 2023 - added 2 commits that reference this issue
on Apr 25, 2024 Experiencing this issue with node v22.5.1, npm 10.8.2, and postject 1.0.0-alpha.6 (the version NPM is installing), with arch linux kernel 6.10.1-arch1-1 Logs:
➜ miscjs mkdir sea ➜ miscjs cd sea ➜ sea echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js ➜ sea echo '{ "main": "hello.js", "output": "sea-prep.blob" }' > sea-config.json ➜ sea node --experimental-sea-config sea-config.json Wrote single executable preparation blob to sea-prep.blob ➜ sea cp $(command -v node) hello ➜ sea ls hello hello.js sea-config.json sea-prep.blob ➜ sea npx postject hello NODE_SEA_BLOB sea-prep.blob \ --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 Start injection of NODE_SEA_BLOB in hello... warning: Can't find string offset for section name '.note' 💉 Injection done! ➜ sea ls hello hello.js sea-config.json sea-prep.blob ➜ sea file hello hello: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8ddabc56835c0401f47b7e9ea29c375bff5d8ebc, for GNU/Linux 4.4.0, stripped ➜ sea ./hello [1] 94256 segmentation fault (core dumped) ./hello ➜ sea echo $? 139- added a commit that references this issue
on May 22, 2026
Doing exactly as documented in https://nodejs.org/api/single-executable-applications.html
On macOS arm64
On Linux x64