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
Error: Multiple occurences of sentinel found in the binary #92
Same on Darwin 23.1.0 with node v21.5.0, injection fails.
I also tested v22.0.0-nightly20240104084d761dfc, which injection appears to be succeeded but the produced binary still doesn't work.
...
➜ npx postject hello NODE_SEA_BLOB sea-prep.blob \
--sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
--macho-segment-name NODE_SEA
npm WARN cli npm v10.2.4 does not support Node.js v22.0.0-nightly20240104084d761dfc. This version of npm supports the following node versions: `^18.17.0 || >=20.5.0`. You can find the latest version at https://nodejs.org/.
Start injection of NODE_SEA_BLOB in hello...
💉 Injection done!
➜ ./hello world
zsh: killed ./hello world
...
const buffer = Buffer.from(data.buffer);
const firstSentinel = buffer.indexOf(sentinelFuse);
if (firstSentinel === -1) {
throw new Error(
`Could not find the sentinel ${sentinelFuse} in the binary`
);
}
const lastSentinel = buffer.lastIndexOf(sentinelFuse);
// if (firstSentinel !== lastSentinel) {
// throw new Error(
// `Multiple occurences of sentinel "${sentinelFuse}" found in the binary`
// );
// }
const colonIndex = firstSentinel + sentinelFuse.length;
if (buffer[colonIndex] !== ":".charCodeAt(0)) {
throw new Error(
`Value at index ${colonIndex} must be ':' but '${buffer[colonIndex].charCodeAt(0)}' was found`
);
}
...
I tried to comments the Error lines, and everything works.
I had the same problem, but found the bug and have a workaround. For me the problem was that I had the sentinel fuse inside of the package.json and this was included in the blob. This in turn confuses if (firstSentinel !== lastSentinel) { as this is indeed not true, even if the that fuse was not used.
I fixed it by base64 encoding the string and in the command decode it before using
Reacted by MarkusG92, Guy Margalit, Joe Van Drunen, genblockmbx, Jörn Reder and Veit Jahns
Activity
bulentv commentedon Jan 5, 2024
Same on Darwin 23.1.0 with node v21.5.0, injection fails.
I also tested v22.0.0-nightly20240104084d761dfc, which injection appears to be succeeded but the produced binary still doesn't work.
targos commentedon Jan 5, 2024
@nodejs/single-executable
cceevv commentedon May 7, 2024
I tried to comments the Error lines, and everything works.
guymguym commentedon Jul 25, 2024
Same for me on MacOS 14.5 with M1 cpu, Darwin Kernel Version 23.5.0.
Tried both with nodejs 20.16.0 and 22.5.1.
in sea-config.json I have:
{ "main": "build/sea.js", "output": "build/sea.blob", "disableExperimentalSEAWarning": true, "useSnapshot": false, "useCodeCache": false, "assets": {} }Patrick-Beuks commentedon Aug 12, 2024
I had the same problem, but found the bug and have a workaround. For me the problem was that I had the sentinel fuse inside of the package.json and this was included in the blob. This in turn confuses
if (firstSentinel !== lastSentinel) {as this is indeed not true, even if the that fuse was not used.I fixed it by base64 encoding the string and in the command decode it before using
gauntface commentedon Feb 10, 2025
I'm running into this issue and looking out the output and blob of my script, I don't have the sentinel referenced anywhere.
EDIT: I was wrong, the sentinel is in the node binary before calling postject.
[Arg = std::string_view &, Args = <const char *, unsigned long>]�NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2:0�Cannot read single executable configuration from %sI've tested on v20 and v23 of node and get the same error with postject
gauntface commentedon Feb 10, 2025
I just tried using an installation of node done via nvm and the injection was successful.
NOTE: I am on mac OS