Repository navigation
Description
Release Type: Official Release
Version: 4.4.0 (Stride.GameStudio NuGet package)
Platform(s): Linux, Game Studio running through Wine/Proton (Fedora Kinoite 44, GE-Proton11-6 = Wine 11.0 Staging, Windows .NET runtime 10.0.13 in the prefix)
Describe the bug
Roughly 30β45 seconds after opening a project, Game Studio freezes completely (no UI updates, thumbnails stop building). It never recovers.
Memory dumps of the frozen process show:
- one thread inside a GC (
!clrthreadsmarks it(GC)), spinning in coreclr's thread suspension loop, - exactly one other managed thread still in cooperative mode, busy-waiting in
Dispatcher.ForBatchedβThreadPool.TryCooperate().
Root cause: since .NET 9, CoreCLR on Windows suspends threads for a GC by injecting a special user-mode APC (QueueUserAPC2 with QUEUE_USER_APC_FLAGS_SPECIAL_USER_APC). Under Wine, that APC is not delivered to a thread that spins in user code without making a system call. The busy-wait in Dispatcher.ForBatched (sources/core/Stride.Core/Threading/Dispatcher.cs, the while (... ) ThreadPool.Instance.TryCooperate(); loop) never makes a syscall while the queue is empty, so the GC waits for it forever and the editor deadlocks.
This is primarily a Wine bug, but Stride can avoid it cheaply (see PR #3600), which would make Game Studio usable through Proton as advertised for 4.4.
To Reproduce
- Run Game Studio 4.4.0 under GE-Proton11-6 (also reproduced with Valve Proton 11, Proton Experimental and proton-cachyos; with ntsync and with fsync).
- Open a project (e.g. the FPS template).
- After ~30β45 s the editor freezes.
Minimal repro without Stride (console app, net10.0, run with the Windows .NET runtime under Wine):
using System.Collections.Concurrent;
// One thread busy-waits like Stride's Dispatcher.ForBatched (TryCooperate loop),
// the main thread forces GCs. "spin" hangs under Wine with .NET 9+, "spinwait" does not.
var mode = args.Length > 0 ? args[0] : "spin";
var queue = new ConcurrentQueue<int>();
var stop = false;
new Thread(() =>
{
var spinWait = new SpinWait();
while (!Volatile.Read(ref stop))
{
bool worked = queue.TryDequeue(out _);
if (mode == "spinwait")
{
if (worked) spinWait.Reset();
else spinWait.SpinOnce(sleep1Threshold: -1);
}
}
}) { IsBackground = true }.Start();
Thread.Sleep(500);
for (int i = 0; i < 20; i++)
{
GC.Collect();
Console.WriteLine($"{mode}: GC {i + 1}/20 done");
}
Volatile.Write(ref stop, true);
Console.WriteLine($"{mode}: OK");Results under GE-Proton11-6 (Wine 11.0 Staging):
| Variant | .NET 8 | .NET 9 | .NET 10.0.13 |
|---|---|---|---|
spin (busy-wait like ForBatched) |
20/20 GCs | 0/20 (hangs) | 0/20 (hangs) |
spinwait (SpinWait.SpinOnce when idle) |
β | β | 20/20 GCs |
busy-wait calling Thread.Yield() / WaitOne(0) |
β | β | 20/20 GCs |
The while (... && !Finished.WaitOne(0)) TryCooperate(); loop further down in Dispatcher.cs is not affected, because WaitOne(0) is a syscall.
Expected behavior
Game Studio keeps working; GCs complete.
Log and callstacks
Frozen state from the dumps: GC thread spinning in coreclr.dll thread suspension; the only cooperative thread is in Stride.Core.Threading.Dispatcher.ForBatched β Stride.Core.Threading.ThreadPool.TryCooperate.
Additional context
- Confirmation of the root cause: forcing CoreCLR to use the pre-.NET 9 suspension path (by making the
QueueUserAPC2lookup fail incoreclr.dll) removes the freeze completely. 2/2 five-minute Game Studio sessions ran without a freeze, all thumbnails were built, and the scene rendered. This is only a local workaround, not something Stride can ship. - Related tracking issue: Proton/Steam Deck compatibilityΒ #3419
Activity
xen2 commentedon Oct 26, 2026
Another possible candidate:
RootRenderFeature.GetOrCreateObjectNodehas an emptywhile (Volatile.Read(...) == -2) { }spin.The thread it waits on calls
objectNodes.Add, which can allocate and trigger a GC, so it could hit the same problem.