Skip to content

Crash on Second World Entry with BetterZoom + Mods Hooking On_FilterManager.EndCapture #22

@hocha113

Description

@hocha113

Description
There seems to be a consistent crash when using BetterZoom together with certain large mods. The crash always happens when entering a world for the second time. As soon as the world loads and the screen is supposed to render, the game freezes for a moment and then crashes to desktop.

From my investigation, the problem seems to occur only when:

  1. BetterZoom is enabled,
  2. and At least one other mod attaches a hook to On_FilterManager.EndCapture.

Depending on the mod load order, the crash may or may not reproduce, but the above two points appear to be the key conditions.

Steps to Reproduce

  1. Enable BetterZoom.
  2. Enable another large mod that hooks into On_FilterManager.EndCapture.
  3. Enter a world.
  4. Exit to the main menu.
  5. Enter a world again.
  6. Crash occurs the moment the world loads.

Mods Tested
Here is the minimized mod list I used that can consistently reproduce the issue (only five mods included):

[
  "BetterZoom",
  "InnoVault",
  "CalamityEntropy",
  "CalamityModMusic",
  "CalamityMod"
]

enabled.json

Logs
client.log (tModLoader’s log) does not capture the crash.
However, when debugging via VS2022, I captured the following output just before the crash:

Terraria: [19:18:02.446] [Main Thread/INFO] [Terraria]: Entering world with player: HoCha113, IsCloud=True, Width: 8400, Height: 2400, Evil: 1, GameMode: 2
[MonoMod.Core] Trace: Undoing simple detour 0x00007ffddfee4230 => 0x00007ffde86cd0d0
程序“[18948] dotnet.exe”已退出,返回值为 3221225477 (0xc0000005) 'Access violation' 

Full crash log:
Access violation.log

Additional Notes:

  1. Crash does not always happen with arbitrary mod combinations.
  2. The issue requires both BetterZoom and another mod using the On_FilterManager.EndCapture hook.
  3. Load order might influence reproducibility.

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