
[1.20.x] Crash due to concurrent access of randomizer
FaeWulf opened this issue ยท 4 comments
crash-2024-02-13_13.41.17-client.txt
Version 1.20,4 - 0.3.2
What modpack, and how often does it occur?
Lastest fabulously optimized.
I don't know what triggering it, not very often, it is very random (sometimes crashed while walking on ice berg, sometimes crashed while building base...)
P/s: I have read stacktrace but have no idea what triggers it.
My mod is a client side mod, meaning my logic executes on the render thread (well, mostly). This crash is telling me that there is another thread that is trying to use a randomizer instance that I created for the render thread, which is something that should not be occurring. I would imagine this issue would be infrequent and occur randomly just as you are experiencing.
EDIT: I think I know what it is. In modern minecraft sounds now have a random instance associated with them. This random could be accessed by an "off thread" in the sound engine. I am using a shared random in the context. Need to rearrange code and add some defenses.