I may have found a possible deadlock introduced by PR #26659 (v5.0.7) that affects browser builds with pthread + dlopen. So far I've only been able to reproduce it in the browser, the same test passes under Node.js.
Reproducer:
Run:
./test/runner browser.test_pthread_dlopen
on commit kleisauke@6025c46.
Stacktrace
Script terminated by timeout at:
_emscripten_get_now@http://localhost:8888/test.js:6232:35
test.wasm.futex_wait_main_browser_thread@http://localhost:8888/test.wasm:wasm-function[122]:0x2f2a
test.wasm._do_futex_wait@http://localhost:8888/test.wasm:wasm-function[121]:0x2da0
test.wasm.emscripten_futex_wait@http://localhost:8888/test.wasm:wasm-function[120]:0x2d3d
test.wasm.__timedwait_cp@http://localhost:8888/test.wasm:wasm-function[183]:0x4731
test.wasm.__pthread_cond_timedwait@http://localhost:8888/test.wasm:wasm-function[185]:0x4942
test.wasm.pthread_cond_wait@http://localhost:8888/test.wasm:wasm-function[197]:0x4d7c
test.wasm.emscripten_proxy_sync_with_ctx@http://localhost:8888/test.wasm:wasm-function[145]:0x38fa
test.wasm.emscripten_proxy_sync@http://localhost:8888/test.wasm:wasm-function[152]:0x3c51
test.wasm._emscripten_proxy_dlsync@http://localhost:8888/test.wasm:wasm-function[69]:0x19f5
createExportWrapper/<@http://localhost:8888/test.js:1014:12
__emscripten_dlsync_threads@http://localhost:8888/test.js:6067:36
test.wasm.load_library_done@http://localhost:8888/test.wasm:wasm-function[79]:0x1e31
test.wasm._dlopen@http://localhost:8888/test.wasm:wasm-function[74]:0x1c64
test.wasm.dlopen@http://localhost:8888/test.wasm:wasm-function[73]:0x1bd0
test.wasm.__original_main@http://localhost:8888/test.wasm:wasm-function[42]:0xdaf
test.wasm.main@http://localhost:8888/test.wasm:wasm-function[44]:0x11a6
callMain@http://localhost:8888/test.js:7792:28
doRun@http://localhost:8888/test.js:7852:32
run/<@http://localhost:8888/test.js:7861:7
setTimeout handler*run@http://localhost:8888/test.js:7859:15
removeRunDependency@http://localhost:8888/test.js:1318:11
initMainThread/<@http://localhost:8888/test.js:1542:30
async*callRuntimeCallbacks@http://localhost:8888/test.js:1280:26
preRun@http://localhost:8888/test.js:905:23
run@http://localhost:8888/test.js:7827:3
removeRunDependency@http://localhost:8888/test.js:1318:11
loadDylibs@http://localhost:8888/test.js:5480:26
async*receiveInstance@http://localhost:8888/test.js:1133:5
receiveInstantiationResult@http://localhost:8888/test.js:1152:12
createWasm@http://localhost:8888/test.js:1186:43
async*@http://localhost:8888/test.js:7878:1
Additional context:
I suspect there's a missing _emscripten_thread_notify() call somewhere in either system/lib/pthread/proxying.c or system/lib/libc/dynlink.c.
I may have found a possible deadlock introduced by PR #26659 (v5.0.7) that affects browser builds with
pthread+dlopen. So far I've only been able to reproduce it in the browser, the same test passes under Node.js.Reproducer:
Run:
./test/runner browser.test_pthread_dlopenon commit kleisauke@6025c46.
Stacktrace
Additional context:
I suspect there's a missing
_emscripten_thread_notify()call somewhere in eithersystem/lib/pthread/proxying.corsystem/lib/libc/dynlink.c.