Hi,
Trying to test my Emscripten project with Asyncify, I recompiled it with tot-upstream, with the same whitelist, but this is failing:
Part 1) Handling function names that change (work-around)
I read that using function prefixes worked as limited wildcard but that doesn't seem to be the case - did I do something wrong?
-s ASYNCIFY_WHITELIST='["__pyx_pf_5renpy_2gl_6gldraw_6GLDraw_"...'
warning: Asyncify whitelist contained a non-existing function name: __pyx_pf_5renpy_2gl_6gldraw_6GLDraw_ ($__pyx_pf_5renpy_2gl_6gldraw_6GLDraw_)
Also llvm-nm doesn't seem to support listing WASM.
I managed to find the function through emcc ... -o fat.llvm && llvm-nm fat.llvm :
003832c5 t __pyx_pf_5renpy_2gl_6gldraw_6GLDraw_28draw_screen
Part 2) Run-time failure
With the updated WHITELIST, I got the dreaded:
RuntimeError: unreachable executed index.wasm:386701:1
__pyx_pw_11pygame_sdl2_7display_21flip
http://localhost:8000/index.wasm:386701
emu$__pyx_pw_11pygame_sdl2_7display_21flip
http://localhost:8000/index.wasm:8749855
15
http://localhost:8000/index.wasm:2587748
__pyx_pf_5renpy_2gl_6gldraw_6GLDraw_28draw_screen
http://localhost:8000/index.wasm:2845914
__pyx_pw_5renpy_2gl_6gldraw_6GLDraw_29draw_screen
http://localhost:8000/index.wasm:2813529
emu$__pyx_pw_5renpy_2gl_6gldraw_6GLDraw_29draw_screen
http://localhost:8000/index.wasm:8760622
PyCFunction_Call
http://localhost:8000/index.wasm:5272869
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5750951
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
function_call
http://localhost:8000/index.wasm:5167287
emu$function_call
http://localhost:8000/index.wasm:8793327
PyObject_Call
http://localhost:8000/index.wasm:5030529
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5754056
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
function_call
http://localhost:8000/index.wasm:5167287
emu$function_call
http://localhost:8000/index.wasm:8793327
PyObject_Call
http://localhost:8000/index.wasm:5030529
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5754056
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5734704
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5734704
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
fast_function
http://localhost:8000/index.wasm:5767904
PyEval_EvalFrameEx
http://localhost:8000/index.wasm:5751409
PyEval_EvalCodeEx
http://localhost:8000/index.wasm:5714071
PyEval_EvalCode
http://localhost:8000/index.wasm:5710418
PyRun_FileExFlags
http://localhost:8000/index.wasm:5955369
PyRun_SimpleFileExFlags
http://localhost:8000/index.wasm:5954716
pyapp_runmain
http://localhost:8000/index.wasm:58353
x
http://localhost:8000/index.js:17649
handleSleep
http://localhost:8000/index.js:17712
safeSetTimeout
http://localhost:8000/index.js:9068
My whitelist:
-s ASYNCIFY_WHITELIST='["main", "pyapp_runmain", "SDL_WaitEvent", "SDL_WaitEventTimeout", "SDL_Delay", "SDL_RenderPresent", "GLES2_RenderPresent", "SDL_GL_SwapWindow", "Emscripten_GLES_SwapWindow", "PyRun_SimpleFileExFlags", "PyRun_FileExFlags", "PyEval_EvalCode", "PyEval_EvalCodeEx", "PyEval_EvalFrameEx", "PyCFunction_Call", "PyObject_Call", "fast_function", "function_call", "instancemethod_call", "slot_tp_call", "__pyx_pw_11pygame_sdl2_5event_7wait", "__pyx_pw_11pygame_sdl2_7display_21flip", "__pyx_pw_11pygame_sdl2_7display_6Window_13flip", "__pyx_pf_5renpy_2gl_6gldraw_6GLDraw_28draw_screen", "__pyx_pw_5renpy_2gl_6gldraw_6GLDraw_29draw_screen", "__Pyx_PyObject_CallNoArg", "__pyx_pf_10emscripten_6sleep", "__pyx_pw_10emscripten_7sleep", "__pyx_pf_10emscripten_8sleep_with_yield", "__pyx_pw_10emscripten_9sleep_with_yield", "gen_send", "gen_send_ex", "gen_iternext", "type_call", "slot_tp_init", "builtin_eval"]'
Not sure if all the "emu$" and "fastfunction" are properly handled :/
Any clue?
Cheers!
Beuc