Open RaisinTen opened 2 years ago
Strange, im having a similar issue on node v21.7.3 for linux. I'm using the node-sea platform to generate an executable blob and inject it into the node executable with postject:
yarn run postject [NODE EXECUTABLE PATH] NODE_SEA_BLOB [EXECUTABLE BLOB PATH] --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2
I believe this bug has something to do with the size of the blob being injected, as it only occurs for me when large files are packaged in the blob. I ran some tests where I injected different size binary blobs that I generated with dd if=/dev/urandom of=./bin bs=1M count=[Size in MB]
. I found that different node platforms have different file size limits regarding what can be injected before crashing. I found these numbers where upper limit is the largest possible blob that can be injected without crashing (+1Mb will cause a crash at this point):
Where x is the size of the blob:
Linux: x < 290 | upper limit = 298Mb
Windows is 493 < x < 494 | upper limit = 493Mb
Darwin is 527 < x < 528 | upper limit = 527Mb
Keep in mind these were all generated on linux. Again if the injected blob is below these specified sizes, no error occurs and the executable works as it should.
uname -a:
Linux [my hostname] 6.8.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 17 Apr 2024 15:20:28 +0000 x86_64 GNU/Linux
free -h:
total used free shared buff/cache available
Mem: 15Gi 5.7Gi 5.4Gi 1.1Gi 5.7Gi 9.7Gi
Swap: 4.0Gi 155Mi 3.8Gi
System info
Linux
Windows
macOS
Versions
Node.js: v16.15.0 (debug build) Postject: Built from https://github.com/postmanlabs/postject/pull/45
Repro
./node
is a debug build of Node.js v16.15.0 and it has a size of 1.4G on Linux, 105M on Windows and 76M on Intel macOS.Error logs
Linux
Windows
macOS
after building with
-sASSERTIONS
. the error looks like this:Linux
Additional info
It works when I inject data into an official release build of the same version of Node.js which is 72M in size on Linux.
Handcrafted stack trace for Linux -