host: fix pre-existing XCB/shm crashes and add an atlas verification tool
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 21s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 19s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 16s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / host-linux (push) Failing after 19s
build / host-windows-cross (push) Failing after 19s
build / obs (clang) (push) Failing after 19s
build / docs (push) Failing after 2s
build / obs (gcc) (push) Failing after 21s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s

captureStop never called the capture interface's stop(), so a backend
running its own threads was torn down while those threads were still
using it. The XCB pointer thread also ran before the host had allocated
the pointer buffers.

The verification tool subscribes as a real client and checks the
published multi-display frame for consistency.
This commit is contained in:
donny committed 2026-07-28 07:21:48 +00:00
1 parent 95e55273ea
commit ba32d48a6a
3 files changed
+298 -1

No files matched your search

+14
View File
@@ -558,6 +558,12 @@ static bool captureStop(void)
DEBUG_INFO("==== [ Capture Stop ] ====");
/* Stop before deinit so a backend that runs its own threads can join them
* while its resources are still valid. Without this a thread can still be
* using the device that deinit is tearing down. */
if (app.iface->stop)
app.iface->stop();
if (!app.iface->deinit())
{
DEBUG_ERROR("Failed to deinitialize the capture device");
@@ -572,6 +578,14 @@ static bool captureStop(void)
bool captureGetPointerBuffer(void ** data, uint32_t * size)
{
PLGMPMemory mem = app.pointerShapeMemory[app.pointerShapeIndex];
/* A backend that captures the pointer on its own thread can reach here
* before lgmpSetup has allocated the pointer buffers, because capture is
* started first. Report that no buffer is available rather than
* dereferencing one that does not exist yet; the backend simply retries. */
if (!mem)
return false;
*data = (uint8_t*)lgmpHostMemPtr(mem) + sizeof(KVMFRCursor);
*size = MAX_POINTER_SIZE - sizeof(KVMFRCursor);
return true;