Closed jeffRTC closed 3 years ago
RTCclient.wasm:0x76f28 Uncaught RuntimeError: memory access out of bounds
at pb (wasm-function[1482]:0x76f28)
at Object.ret.<computed> [as dynCall_vi] (runtime.js:16:44665)
at RTCDataChannel.cb (runtime.js:16:111358)
My application too heavy on Asyncify. I just wondering what are your thoughts on this?
As the doc says, asyncify coexisting with callbacks should not be a problem but you have to carefully watch for possible race conditions.
In particular, the doc says "It is not safe to start an async operation while another is already running", so for instance if you call emscripten_sleep()
and a callback is triggered while sleeping, if you call emscripten_sleep()
in the callback, it will crash.
RTCclient.wasm:0x76f28 Uncaught RuntimeError: memory access out of bounds at pb (wasm-function[1482]:0x76f28) at Object.ret.<computed> [as dynCall_vi] (runtime.js:16:44665) at RTCDataChannel.cb (runtime.js:16:111358)
This looks like a segmentation fault in wasm code triggered by a callback. You should try building with the address sanitizer.
so for instance if you call emscripten_sleep() and a callback is triggered while sleeping, if you call emscripten_sleep() in the callback, it will crash.
That's what actually happen here. A callback receives while it sleeping and it crash.
But if I remove the async stuff from code, it doesn't crash..
I'm am about to move the async code as a JS library like datachannel-wasm done
Lib is right way to do this. I copied pasted your code..
Closing...
I see a lot of issues lately and I probably think your events causing this. As per emscripten docs,
My application too heavy on Asyncify. I just wondering what are your thoughts on this?
For example,
If you call this function 1000 times from JS side, the said behavior happen..