mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-27 00:20:53 +01:00
[PR #1135] xgameruntime: release g_error_mutex before invoking XErrorCallback in XErrorReport (OLD-9887) #1168
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#1168
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/1135
Author: @ambroseautomation
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:carry/old-9887-xerror-reentrancy📝 Commits (1)
cab5c18fix(xgameruntime): release g_error_mutex before invoking XErrorCallback in XErrorReport📊 Changes
2 files changed (+49 additions, -2 deletions)
View changed files
📝
runtime/shims/xgameruntime.cpp(+8 -2)📝
runtime/test/xgameruntime_test.cpp(+41 -0)📄 Description
Claimed in the coordination issue as: OLD-9887 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7141584617)
What and why
Carries forward
old-pr/9887(draft #156, original commit authortotoniipreserved; indexed in #17), rebased cleanly onto currentmain(6293c1c4f).Fixes a re-entrancy deadlock in
error_report(XErrorReport) inruntime/shims/xgameruntime.cpp:g_error_callbackandg_error_contextunderg_error_mutex, then releases the lock before invoking the callback so a callback that callsXErrorReportorXErrorSetCallbackre-entrantly does not deadlock.runtime/test/xgameruntime_test.cppthat invokes both nestedXErrorReportandXErrorSetCallback(nullptr, nullptr)from inside the callback with a 2-second deadlock timeout.Tested
xgameruntime_test.exenatively on Windows 11 with MSVC (/std:c++20 /EHsc /W4 /permissive- /utf-8 /O2):xgameruntime_test: OK (159 checks), including the new re-entrancy test.python -I scripts/check_no_game_data.py runtime/shims/xgameruntime.cpp runtime/test/xgameruntime_test.cpp: exit 0 (no game data).GPUs tested: n/a (CPU/OS runtime shim; built and tested on Windows 11 Pro 64-bit, MSVC VS 18)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a —xgameruntimeshim)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.