Concurrent Chunk Management Engine (Fabric)

Concurrent Chunk Management Engine (Fabric)

231k Downloads

Anvile Heads and enforceSafeWorldRandomAccess

lexi-the-cute opened this issue ยท 1 comments

commented

Describe the bug
Anvil Heads causes issues when combined with C2ME while enforceSafeWorldRandomAccess is enabled

[10:07:50] [pool-28-thread-1/INFO]: Successfully dropped player head due to Anvil death!
[10:07:50] [Server thread/INFO]: [STDOUT]: [Gravestones] Gravestone spawned at: 25, -60, -1
[10:07:50] [pool-28-thread-1/ERROR]: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: pool-28-thread-1)
This is usually NOT a bug in C2ME, but a bug in another mod or in vanilla code. 
Possible solutions: 
  - Find possible causes in the stack trace below and 
    - if caused by another mod, report this to the corresponding mod authors 
    - if no other mods are involved, report this to C2ME 

java.util.ConcurrentModificationException: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: pool-28-thread-1)
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.handleNotOwner(CheckedThreadLocalRandom.java:55) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.isSafe(CheckedThreadLocalRandom.java:38) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.method_43156(CheckedThreadLocalRandom.java:86) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at net.minecraft.class_6566.method_43058(class_6566.java:61) ~[client-intermediary.jar:?]
	at net.minecraft.class_1542.<init>(net/minecraft/class_1542.java:59) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_5699(net/minecraft/class_1297.java:1998) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_5775(net/minecraft/class_1297.java:1986) ~[client-intermediary.jar:?]
	at net.minecraft.class_1309.mded2217$anvil-heads$lambda$dropHead$0$0(net/vexio/anvilheads/mixin/LivingEntityMixin.java [anvil-heads.mixins.json]:42) ~[client-intermediary.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]
[10:07:50] [pool-28-thread-1/ERROR]: Uncaught exception in thread "pool-28-thread-1"
com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom$1: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: pool-28-thread-1)
This is usually NOT a bug in C2ME, but a bug in another mod or in vanilla code. 
Possible solutions: 
  - Find possible causes in the stack trace below and 
    - if caused by another mod, report this to the corresponding mod authors 
    - if no other mods are involved, report this to C2ME 
 
 (You may make this a fatal warning instead of a hard crash with fixes.enforceSafeWorldRandomAccess setting in c2me.toml)
Caused by: java.util.ConcurrentModificationException: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: pool-28-thread-1)
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.handleNotOwner(CheckedThreadLocalRandom.java:55) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.isSafe(CheckedThreadLocalRandom.java:38) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at com.ishland.c2me.fixes.worldgen.threading_issues.common.CheckedThreadLocalRandom.method_43156(CheckedThreadLocalRandom.java:86) ~[c2me-fixes-worldgen-threading-is+alpha.11.0-2be00463cd52419d.jar:?]
	at net.minecraft.class_6566.method_43058(class_6566.java:61) ~[client-intermediary.jar:?]
	at net.minecraft.class_1542.<init>(net/minecraft/class_1542.java:59) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_5699(net/minecraft/class_1297.java:1998) ~[client-intermediary.jar:?]
	at net.minecraft.class_1297.method_5775(net/minecraft/class_1297.java:1986) ~[client-intermediary.jar:?]
	at net.minecraft.class_1309.mded2217$anvil-heads$lambda$dropHead$0$0(net/vexio/anvilheads/mixin/LivingEntityMixin.java [anvil-heads.mixins.json]:42) ~[client-intermediary.jar:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
	at java.lang.Thread.run(Thread.java:833) ~[?:?]

To Reproduce
Steps to reproduce the behavior:

  1. Die by Anvil

Expected behavior
Head to drop on death with no error message

Screenshots
N/A

Runtime info (please complete the following information):

  • OS: Arch Linux
  • Minecraft version: 1.12.1
  • Mod version: v0.2.0+alpha.11.0

Other mods
Anvil Heads - v1.0-1.20.1

Checklist

  • I am using the official version of the mod.
  • I tried the latest development version but the issue persists.
  • I searched for similar open issues and could not find an existing bug report on this.

Additional context
Disabling enforceSafeWorldRandomAccess allows the mods to work normally. Also reported to vexio/anvil_heads#2

commented

anvil_head is modifying world state on another thread. This results in undefined behavior.