-
Notifications
You must be signed in to change notification settings - Fork 1.1k
runtime crashes when compiling to web-assembly #607
Comments
Ok this issue is really weird and i am almost starting to think it is compiler bug or something like that, and not nuklear fault. The issue only happens in optimized build, debug build runs fine . |
the issue can be fixed with compiler/linker option -s "BINARYEN_TRAP_MODE='clamp'" but it adds some small performance overhead. If anybody wants to play around with web-assembly and try find the real cause for this issue I created a minimalistic example here: https://github.com/Deins/nuklear_wasm_bug_test |
How does it behave with |
Your post just saved my day and I managed to push out my entry for LD43, but still it looks like it's very slow on Windows, while on macOS it works fine. It would be nice to correct the real issue though. It looks like most of them are just integer overflows. |
I opened a new issue there #774 with all the information I've put together over the past weekend. |
Hi, when i compile this library to web assembly (using emscripten) some functions cause nuklear to crash. For example nk_label_colored crashes when finishing frame (inside nk_convert) with error:
chrome:
firefox:
Regular labels work without problems. Also x86 or x64 builds and runs without any problems. I have integrated nuklear in my own opengl pipeline, but that doesn't seem to be the problem, as the nuklear crashes when building the vertex buffers internally.
I haven't really learned how to debug wasm, however i found that the crashing instruction lays inside nk_draw_vertex near the while cycle or in the nk_draw_vertex_layout_element_is_end_of_layout.
Does nuklear intentionally use integer overflow? Or maybe use some unaligned reads or something other unportable which could cause these problems?
P.S. asm.js build with emscripten also runs without problems.
example code:
The text was updated successfully, but these errors were encountered: