-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Fix unexpected runtime exit with EXIT_RUNTIMEwhile calling glfwSetWindowSize
#17376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| #if USE_GLFW == 3 | ||
| {{{ makeDynCall('viii', 'GLFW.active.windowSizeFunc') }}}(GLFW.active.id, GLFW.active.width, GLFW.active.height); | ||
| #endif | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that if the runtime is no longer active we do want to exit here. See the keepRuntimeAlive function.. for some reason it must b returning false in your use case, and its probably worth looking into why.
tests/glfw3.c
Outdated
| glfwGetWindowPos(window, &x, &y); // stub | ||
| glfwGetWindowSize(window, &w, &h); | ||
| assert(w == 640 && h == 480); | ||
| assert(exited == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this assert fire if you won't include your patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this assert is just in the incorrect line. thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it fires, without this patch? (i.e. if I add this assert locally I will see the test fail?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion fires with -sEXIT_RUNTIME=1.
(I've used --emrun, which implies -sEXIT_RUNTIME=1)
EXIT_RUNTIMEwhile calling glfwSetWindowSize
|
I think I found the root of the issue and will upload a patch shortly. Thanks for figuring out where this issue was showing up! |
See #17376 for the original report inspiration for the modified test.
See #17376 for the original report inspiration for the modified test.
|
I think #17438 should fix this issue. |
See #17376 for the original report inspiration for the modified test.
See #17376 for the original report inspiration for the modified test.
When called
glfwSetWindowSize, emscripten runtime will exit unintentionally.