With the llvm-wasm backend, I'm hitting a couple of instances where when trying to free some memory with free(), emscripten is aborting at runtime saying that dlfree() is undefined. From what I can tell, memory functions are transformed to use the dlmalloc implementation that emscripten uses and builds. When looking at the compiled library in my .emscripten_cache (libdlmalloc-mt-debug.a), I see those functions defined in the text section as expected(dlfree, dlmalloc, etc).
I'm curious when this transformation happens (it's not during preprocessing), and if it's missing some other step. The reason I wonder about that is because I also see references to emscripten_builtin_malloc and emscripten_builtin_free.
The error:
worker.js onmessage() captured an uncaught exception: RuntimeError: abort(undefined) at jsStackTrace
stackTrace @xxx
abort @xxx
_abort @xxx
dlfree @xxx (our call to free)
........
Has anyone seen this before, and is this something I'm doing wrong when compiling/linking? This is using emscripten 1.39.7.