miner-ray / miner-ray.github.io

This repo contains the data and tools from the accompanying "MinerRay: Semantics-Aware Analysis for Ever-EvolvingCryptojacking Detection"ASE 2020 submission
7 stars 3 forks source link

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #20

Open HakonHarnes opened 1 year ago

HakonHarnes commented 1 year ago

Description

I'm encountering some errors when trying to analyze the provided sample WebAssembly binaries. Is this an issue in my setup, or do you also encounter this issue?

Stack traces

$ wasm2wat Data/SampleWasmFiles/3a1da6d43c7f8e24.ok.wasm -o test.wat
$ node --expose-gc --max-old-space-size=8192 Parser/parser.js --file test.wat

<--- Last few GCs --->

[59325:0x555bfd141ed0]   103572 ms: Scavenge 4048.9 (4129.3) -> 4042.6 (4129.8) MB, 5.7 / 0.0 ms  (average mu = 0.199, current mu = 0.309) allocation failure;
[59325:0x555bfd141ed0]   103589 ms: Scavenge 4049.6 (4129.8) -> 4043.3 (4130.8) MB, 5.8 / 0.0 ms  (average mu = 0.199, current mu = 0.309) allocation failure;
[59325:0x555bfd141ed0]   103609 ms: Scavenge 4050.3 (4130.8) -> 4044.0 (4146.8) MB, 8.7 / 0.0 ms  (average mu = 0.199, current mu = 0.309) allocation failure;

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0x7fee82c83d0d node::Abort() [/usr/bin/../lib/libnode.so.111]
 2: 0x7fee82968cdb node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/usr/bin/../lib/libnode.so.111]
 3: 0x7fee83047f64 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/bin/../lib/libnode.so.111]
 4: 0x7fee83048358 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/bin/../lib/libnode.so.111]
 5: 0x7fee8323aa3c  [/usr/bin/../lib/libnode.so.111]
 6: 0x7fee83255224 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/../lib/libnode.so.111]
 7: 0x7fee83230217 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/../lib/libnode.so.111]
 8: 0x7fee8323143a v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/../lib/libnode.so.111]
 9: 0x7fee832146cf v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/bin/../lib/libnode.so.111]
10: 0x7fee835f4cd1 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/../lib/libnode.so.111]
11: 0x7fee82f433f9  [/usr/bin/../lib/libnode.so.111]
ajromano1 commented 1 year ago

Thank you for raising this issue. It seems you are encountering the issue with the heap running out of memory. We have also encountered this issue as well for larger files. For some larger files .wasm (less than around 20MB), they can be processed if the function call linking, which improves the detection rate, is disabled. This can be done by modifying commenting out Lines #2697-2699 in the Parser/parser.js file. In addition, the program may try to run the cached Redis abstractions, so you also need to uncomment Line #1740 to prevent the cached Redis values from being used.