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
macOS Ventura 13.6.4 (darwin-arm64)
MacBook Air M1
Node v20.11.1 (darwin-arm64)
Exactly following these docs I tried to inject a 7MB JS blob into a darwin-x64 node executable on the platform described above. This works without showing any error. But if I start the generated executable it fails with Segmentation fault: 11. It doesn't matter if I sign the generated executable or not, the error remains the same.
Doing the exact same thing but with a darwin-arm64 node executable works without problems. Below is the full content from the error report dialog which appears afterwards and shows a lot of V8 related error messages (note: the original app name has been replaced with [REDACTED]). Is it a known problem, that this kind of cross-platform doesn't work?
Edit: the same is true vice versa: injecting into a darwin-arm64 node executable on darwin-x64 also works but leads to the same error.
I have found the reason for this problem. The problem is not the behavior of postject, but a 'misconfiguration' of the blob generation when used in the context of a Node.js SEA.
The only problem is that useCodeCache has been set to true. This seems to create a blob that is specific to the platform it is created on, which also explains all the stack trace messages related to V8 in my original problem report. When useCodeCache is set to false, everything works fine.
Since many people seem to use postject for creating Node SEAs, it might be worth including this note in the documentation.
So it is indeed possible to create Node.js SEAs on any platform for any platform supported by postject, which is really nice (thanks for this project!).
For the specific case of injecting resources into a darwin-* executable on a Windows or Linux platform, the Apple Codesign project is a gem: it provides pre-built signing tools that allow signing darwin-* executables on win32 and linux (and also darwin) platforms. Signing is necessary at least for darwin-arm64 executables, otherwise they will no longer run after injection.
mn4367
changed the title
Signing a darwin-x64 node executable on darwin-arm64 leads to a segmentation fault when started
Signing a darwin-x64 node executable on darwin-arm64 leads to a segmentation fault when started [SOLVED]
Apr 8, 2024
macOS Ventura 13.6.4 (
darwin-arm64
)MacBook Air M1
Node v20.11.1 (
darwin-arm64
)Exactly following these docs I tried to inject a 7MB JS blob into a
darwin-x64
node executable on the platform described above. This works without showing any error. But if I start the generated executable it fails withSegmentation fault: 11
. It doesn't matter if I sign the generated executable or not, the error remains the same.Doing the exact same thing but with a
darwin-arm64
node executable works without problems. Below is the full content from the error report dialog which appears afterwards and shows a lot of V8 related error messages (note: the original app name has been replaced with[REDACTED]
). Is it a known problem, that this kind of cross-platform doesn't work?Edit: the same is true vice versa: injecting into a
darwin-arm64
node executable ondarwin-x64
also works but leads to the same error.Full error report:
The text was updated successfully, but these errors were encountered: