emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.6k stars 3.28k forks source link

cannot use 'emmalloc-memvalidate-verbose' flag #19934

Open ssethwwang opened 1 year ago

ssethwwang commented 1 year ago

Please include the following in your bug report:

Version of emscripten/emsdk: 3.1.27

APP crash at the wasm_call_ctor with build flag -sMALLOC="emmalloc-memvalidate-verbose".

the call stack is: wasm_call_ctor-->initialize_emmalloc_heap---->claim_more_memory--->validate_memory_regions

I checked the source code. In the function validate_memory_regions, it tries to assert the mutex 'multithreadingLock'. On the call stack, there is no place to call the MALLOC_ACQUIRE.

Is it a bug?

sbc100 commented 1 year ago

Likely a gap in our testing where all possible combinations are of emmalloc config are not tested.

@juj?

juj commented 1 year ago

This is #19465, but that wasn't able to land before I went on summer vacation. Let me take a look at that now.

illarionov commented 2 months ago

@juj Is there any update? Looks like everything was done, but was not merged?