You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SEA created following Node.js documentation doesn't work #76
Regarding the macOS issue, could you try running codesign --sign - hello and 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.
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?
@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.
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!
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
Activity
RaisinTen commentedon Feb 22, 2023
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.targos commentedon Feb 22, 2023
That works! I think it should be documented somewhere.
doc: add steps about signing the binary in single-executable docs
RaisinTen commentedon Feb 22, 2023
Done - nodejs/node#46764!
RaisinTen commentedon Feb 23, 2023
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?
targos commentedon Feb 23, 2023
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:
Compile:
Edit: found the release build for 19.7.0
RaisinTen commentedon Feb 25, 2023
@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:
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.
doc: add steps about signing the binary in single-executable docs
fix: crash in `postject_find_resource()` on Linux
RaisinTen commentedon Feb 27, 2023
I've confirmed that #77 fixes the issue.
fix: crash in `postject_find_resource()` on Linux (#77)
doc: add steps about signing the binary in single-executable docs
deps,test: update postject to 1.0.0-alpha.5
doc: add steps about signing the binary in single-executable docs
deps,test: update postject to 1.0.0-alpha.5
targos commentedon Mar 16, 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:
deps,test: update postject to 1.0.0-alpha.5
doc: add steps about signing the binary in single-executable docs
doc: add steps about signing the binary in single-executable
doc: add steps about signing the binary in single-executable
Oman395 commentedon Jul 27, 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:
deps,test: update postject to 1.0.0-alpha.5
fix: pass --macho-segment-name NODE_SEA to postject on macOS