Closed snickerbockers closed 6 years ago
Even with the following patch applied, it still segfaults. Therefore, it's not the core emulation code that's causing this.
diff --git a/src/main.c b/src/main.c
index 3cec069..bfec5c2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -258,7 +258,7 @@ int main(int argc, char **argv) {
config_set_enable_cmd_tcp(enable_cmd_tcp);
config_set_ser_srv_enable(enable_serial);
- dreamcast_run();
+ /* dreamcast_run(); */
gfx_cleanup();
I am still able to reproduce the crash with the following minimalistic program. Ergo, the root-cause of this bug is not in WashingtonDC.
#include <err.h>
#include <stdio.h>
#include <GLFW/glfw3.h>
static unsigned const res_x = 800, res_y = 600;
static GLFWwindow *win;
int main(int argc, char **argv) {
printf("hello, glfwtest!\n");
if (!glfwInit())
err(1, "unable to initialize glfw");
win = glfwCreateWindow(res_x, res_y, "glfwtest", NULL, NULL);
glfwTerminate();
return 0;
}
The crash happens with glfw@999f3556fdd80983b10051746264489f2cb1ef16 (which is the 3.2.1 tag) but not with glfw@f4cd470bcbca37b53355acf6deb172f33ccef675 (which is the current HEAD of master).
Therefore, I believe there is a bug in glfw but that bug has already been fixed so all I need to do is upgrade to a more recent version.
Fixed by bda50e98f69828ead0b9d1676d9afebb07ceca70.
I consistently see WashingtonDC crash with the following segfault on my laptop (and only on my laptop, it's fine on my desktop):
This crash happens after I alt+f4 WashingtonDC. There do not appear to be any problems while the emulator is running. Additionally, I have verified that the bug is reproducible on both the JIT and the interpreter.
The bug is reliably reproducible regardless of how long WashingtonDC has been running, so it should be possible to narrow down the scope by removing the main loop (so that it starts up and immediately closes) to see if it's being caused by the core emulation code, or the window/input code.
This seems to have been introduced by d1cc46ab3e2fca3fcfd20866065c865313a9ccb4, but since this is a volatile bug that commit may or may not actually be the root-cause. This is a commit which migrated WashingtonDC from using whatever version of glfw happens to be on the user's machine at build-time to downloading a specific version of glfw (via git submodule) and using that.