LambDynamicLights

LambDynamicLights

23M Downloads

1.21.5 crash on /reload

YoavTC opened this issue · 1 comments

commented

Describe the bug
The game crashes when I execute /reload. Consistently crashes the client, not just a one-time thing.

Desktop:

  • OS: Windows 11

  • Minecraft 1.21.5

  • Fabric Loader version 0.16.13

  • Mods:
    puzzleslib: Puzzles Lib 21.5.5
    shulkerboxtooltip: Shulker Box Tooltip 5.2.5+1.21.5
    sodium: Sodium 0.6.12+mc1.21.5
    sound_physics_remastered: Sound Physics Remastered 1.21.5-1.4.10
    tia: Tiny Item Animations 1.2.2
    mousetweaks: Mouse Tweaks 2.27
    notenoughanimations: NotEnoughAnimations 1.9.3
    modmenu: Mod Menu 14.0.0-rc.2
    midnightcontrols: MidnightControls 1.10.6
    lambdynlights: LambDynamicLights 4.2.3+1.21.5
    freecam: Freecam 1.3.3+mc1.21.5
    ferritecore: FerriteCore 8.0.0
    forgeconfigapiport: Forge Config API Port 21.5.1
    fabric-language-kotlin: Fabric Language Kotlin 1.10.19+kotlin.1.9.23
    fabricloader: Fabric Loader 0.16.13
    fabric-api: Fabric API 0.119.9+1.21.5
    essential: Essential 1.3.5.12
    essential-container: essential-container 1.0.0
    elementa: Elementa 700
    entity_texture_features: Entity Texture Features 6.2.13
    distanthorizons: Distant Horizons 2.3.2-b
    betterf3: BetterF3 14.0.0
    armorstatues: Armor Statues 21.5.0

  • Version 4.2.3

  • Branch 1.21.5

Additional context
Here's the crash log: https://pastebin.com/VfQjF1X2

commented

I was not able to reproduce this crash in development, though the crash report was plentiful to locate the issue: when LambDynamicLights finalize loading resources from resource packs, which can happen if a tag gets updated (which /reload says to the client so), it will try to rebuild a list of item and entity light sources to apply, turns out this was done in an unsafe manner: the list is cleared then filled again and something else could attempt to read from it while this happens.

The fix was simple, create a separate list and fill, then replace the old one by the new one directly. This creates a more stable state change.

The fix should be available with LambDynamicLights v4.2.5, though I haven't been able to test it since no reproduction, but I am confident enough it should fix it.