summary refs log tree commit diff stats
path: root/results/scraper/fex/2189
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-07-17 09:10:43 +0200
committerChristian Krinitsin <mail@krinitsin.com>2025-07-17 09:10:43 +0200
commitf2ec263023649e596c5076df32c2d328bc9393d2 (patch)
tree5dd86caab46e552bd2e62bf9c4fb1a7504a44db4 /results/scraper/fex/2189
parent63d2e9d409831aa8582787234cae4741847504b7 (diff)
downloadqemu-analysis-main.tar.gz
qemu-analysis-main.zip
add downloaded fex bug-reports HEAD main
Diffstat (limited to 'results/scraper/fex/2189')
-rw-r--r--results/scraper/fex/218954
1 files changed, 54 insertions, 0 deletions
diff --git a/results/scraper/fex/2189 b/results/scraper/fex/2189
new file mode 100644
index 000000000..9064f0c9f
--- /dev/null
+++ b/results/scraper/fex/2189
@@ -0,0 +1,54 @@
+How can I fix crashed In XSetErrorHandler?
+source code:

+https://github.com/opengl-tutorials/ogl

+

+how to reproduce:

+1. open -DBUILD_THUNKS, build FEXLoader

+2. run tutorial01_first_window

+3. FEXLoader crashed

+

+Guest Code error position: ogl/external/glfw-3.1.2/src/x11_init.c:680, XSetErrorHandler

+```

+void _glfwReleaseXErrorHandler(void)

+{

+    // Synchronize to make sure all commands are processed

+    XSync(_glfw.x11.display, False);

+    XSetErrorHandler(NULL);

+}

+```

+

+FEXLoader Crash position: Thunks.cpp:436, FinalizeHostTrampolineForGuestFunction

+```

+    FEX_DEFAULT_VISIBILITY

+    void FinalizeHostTrampolineForGuestFunction(HostToGuestTrampolinePtr* TrampolineAddress, void* HostPacker) {

+      auto& Trampoline = GetInstanceInfo(TrampolineAddress);

+

+      LOGMAN_THROW_A_FMT(Trampoline.CallCallback == (uintptr_t)&ThunkHandler_impl::CallCallback,

+                        "Invalid trampoline at {} passed to {}", fmt::ptr(TrampolineAddress), __FUNCTION__);

+

+      if (!Trampoline.HostPacker) {

+        LogMan::Msg::DFmt("Thunks: Finalizing trampoline at {} with host packer {}", fmt::ptr(TrampolineAddress), fmt::ptr(HostPacker));

+        Trampoline.HostPacker = HostPacker;

+      }

+    }

+```

+

+It seems when I pass a callback ptr is NULL to XSetErrorHandler, TrampolineAddress is NULL too, so GetInstanceInfo return error info. and LOGMAN_THROW_A_FMT thow a exception.

+

+so is it right to fix this problem like this, immediate return when TrampolineAddress is NULL:

+```

+    FEX_DEFAULT_VISIBILITY

+    void FinalizeHostTrampolineForGuestFunction(HostToGuestTrampolinePtr* TrampolineAddress, void* HostPacker) {

+      if (TrampolineAddress == nullptr) return;

+

+      auto& Trampoline = GetInstanceInfo(TrampolineAddress);

+

+      LOGMAN_THROW_A_FMT(Trampoline.CallCallback == (uintptr_t)&ThunkHandler_impl::CallCallback,

+                        "Invalid trampoline at {} passed to {}", fmt::ptr(TrampolineAddress), __FUNCTION__);

+

+      if (!Trampoline.HostPacker) {

+        LogMan::Msg::DFmt("Thunks: Finalizing trampoline at {} with host packer {}", fmt::ptr(TrampolineAddress), fmt::ptr(HostPacker));

+        Trampoline.HostPacker = HostPacker;

+      }

+    }

+```