emscripten icon indicating copy to clipboard operation
emscripten copied to clipboard

RuntimeError: memory access out of bounds

Open ManishJu opened this issue 9 months ago • 7 comments

I am trying to compile the raytracing in a weekend which is perfectly compiling in the Xcode Here is the link to the repo I am compiling , its a simple c++ raytracer : https://github.com/ManishJu/Raytracer_2ndWeek.git Version of emscripten/emsdk: emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.61-git clang version 19.0.0git

Failing command line in full:

emcc main.cpp -O3 -o 1.html  -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -sSTACK_SIZE=10000000  && node --node-memory-debug  a.out.js

Here is the console log I am getting :


...../a.out.js:128
      throw ex;
      ^

RuntimeError: memory access out of bounds
    at wasm://wasm/001b0002:wasm-function[289]:0x37aab
    at wasm://wasm/001b0002:wasm-function[272]:0x35936
    at wasm://wasm/001b0002:wasm-function[123]:0xf9ec
    at wasm://wasm/001b0002:wasm-function[123]:0xfa5b
    at wasm://wasm/001b0002:wasm-function[123]:0xfa5b
    at wasm://wasm/001b0002:wasm-function[123]:0xfa5b
    at wasm://wasm/001b0002:wasm-function[123]:0xfa5b
    at wasm://wasm/001b0002:wasm-function[125]:0x10242
    at ..../a.out.js:641:12
    at callMain ..../a.out.js:4936:15)

Node.js v22.2.0

The issue is similar to issue #21848 . I tried using optimisation flag and increasing stack size but with no success

ManishJu avatar Jun 02 '24 11:06 ManishJu