Skip to content

v1.1.2: opening modding screen crashes game (stack overflow 0xC00000FD) - UpdateLayout/Resized recursion from 863bdef #4

Closed

Description

@BetulaSuk

title: "v1.1.2: Opening the modding screen hard-crashes the game (native stack overflow 0xC00000FD) — infinite UpdateLayout/Resized recursion introduced in 863bdef" (repeated with issue #3)
labels: []

Summary

Since v1.1.2, opening the in-game Modding screen (Settings → Mods, where BetterModMenu hooks in) freezes the game for a few seconds and then hard-crashes to desktop. On Windows the crash is a native stack overflow (0xC00000FD) — the log ends right where the modding screen builds, with no managed exception.

Reproduced 5/5 times today on v1.1.2 (installed via Steam Workshop, game v0.111.0, Windows 11, ~40 mods installed). v1.1.1 was fine.

Root cause (precise)

Commit 863bdef ("Fix top bar layout across resizes") rewrote MakeRoomAboveModsPanel in Patches/ModdingScreenChromeOps.cs. The new version undoes and re-applies the top-bar room on every layout pass, so scrollContainer.Size actually changes every time.

The loop:

  1. EnsureLayoutSignals (same file) subscribes UpdateLayoutIfCurrent → UpdateLayout to the Resized signal of %ModsScrollContainer (and the screen).
  2. UpdateLayout → MakeRoomAboveModsPanel modifies scrollContainer.Size.
  3. Setting Control.Size in Godot emits Resized synchronously.
  4. → step 2 again, unbounded recursion → stack overflow.

Pre-1.1.2 the room was applied once (guarded by the removed TopBarRoomMeta metadata flag), so the size never churned and no loop existed.

Suggested fix

Two independent, cheap guards (either stops the crash; both together are safest):

  1. Re-entrancy guard in UpdateLayout:
    if (session.IsUpdatingLayout) return;
    session.IsUpdatingLayout = true;
    try { /* existing layout logic */ }
    finally { session.IsUpdatingLayout = false; }
  2. Skip no-op re-application in MakeRoomAboveModsPanel:
    if (session.AppliedTopBarRoomHeight == height) return;

I built a local DLL with fix #1 and the modding screen opens normally again — no crash, layout intact.

Environment

  • BetterModMenu v1.1.2 (workshop id 3748029698), installed 2026-10-25 02:39
  • Game v0.111.0 (Godot 4.5.1), Windows 11 26200, RTX 3060 laptop
  • Crash signature: Exception code: 0xc00000fd, faulting app SlayTheSpire2.exe, 5 crashes between 13:43–14:02 local, all within ~1 min of launch at modding-screen open

This issue was drafted and filed by an AI agent (GLM5.3, on behalf of the reporter) after log/Event-Log/source analysis. The diagnosis and suggested patch above are machine-generated but locally verified against v1.1.2 source.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions