YUNG's Better Strongholds (Fabric)

YUNG's Better Strongholds (Fabric)

17M Downloads

[Fabric] Concurrent access exception

Qendolin opened this issue ยท 3 comments

commented

I was flying around my world when suddenly

[01:02:37] [Worker-Main-4/FATAL]: Failed to light chunk [-229, 170]
java.util.concurrent.CompletionException: net.minecraft.class_148: Accessing PalettedContainer from multiple threads
	at Not Enough Crashes deobfuscated stack trace.(1.17.1+build.59) ~[?:?]
	at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314) ~[?:?]
	at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1155) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) ~[?:?]
	at net.minecraft.server.world.ChunkTaskPrioritySystem.method_17634(ChunkTaskPrioritySystem:58) ~[?:?]
	at net.minecraft.util.thread.TaskExecutor.runNext(TaskExecutor:91) ~[?:?]
	at net.minecraft.util.thread.TaskExecutor.runWhile(TaskExecutor:146) ~[?:?]
	at net.minecraft.util.thread.TaskExecutor.run(TaskExecutor:102) ~[?:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1434) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:295) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1016) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1665) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1598) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) [?:?]
Caused by: net.minecraft.class_148: Accessing PalettedContainer from multiple threads
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17225(ThreadedAnvilChunkStorage:568) ~[?:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?]
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17224(ThreadedAnvilChunkStorage:550) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?]
	... 11 more
Caused by: java.lang.IllegalStateException
	at net.minecraft.util.thread.LockHelper.crash(LockHelper:27) ~[?:?]
	at net.minecraft.util.thread.LockHelper.checkLock(LockHelper:19) ~[?:?]
	at net.minecraft.world.chunk.PalettedContainer.lock(PalettedContainer:50) ~[?:?]
	at net.minecraft.world.chunk.PalettedContainer.setSync(PalettedContainer:110) ~[?:?]
	at net.minecraft.world.chunk.ChunkSection.setBlockState(ChunkSection:66) ~[?:?]
	at net.minecraft.world.chunk.ChunkSection.setBlockState(ChunkSection:60) ~[?:?]
	at net.minecraft.world.chunk.ProtoChunk.setBlockState(ProtoChunk:179) ~[?:?]
	at com.yungnickyoung.minecraft.betterstrongholds.world.processor.LegProcessor.process(LegProcessor.java:44) ~[BetterStrongholds-Fabric-1.17-1.1.1.jar:?]
	at net.minecraft.structure.Structure.process(Structure:385) ~[?:?]
	at net.minecraft.structure.Structure.place(Structure:228) ~[?:?]
	at net.minecraft.structure.pool.SinglePoolElement.generate(SinglePoolElement:126) ~[?:?]
	at net.minecraft.structure.PoolStructurePiece.generate(PoolStructurePiece:88) ~[?:?]
	at net.minecraft.structure.PoolStructurePiece.generate(PoolStructurePiece:84) ~[?:?]
	at net.minecraft.structure.StructureStart.generateStructure(StructureStart:97) ~[?:?]
	at net.minecraft.world.biome.Biome.method_28401(Biome:366) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:?]
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
	at java.util.PrimitiveIterator$OfLong.forEachRemaining(PrimitiveIterator.java:189) ~[?:?]
	at it.unimi.dsi.fastutil.longs.LongIterator.forEachRemaining(LongIterator.java:53) ~[fastutil-8.2.1.jar:?]
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801) ~[?:?]
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?]
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?]
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?]
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?]
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596) ~[?:?]
	at net.minecraft.world.biome.Biome.generateFeatureStep(Biome:365) ~[?:?]
	at net.minecraft.world.gen.chunk.ChunkGenerator.generateFeatures(ChunkGenerator:245) ~[?:?]
	at net.minecraft.world.chunk.ChunkStatus.method_12151(ChunkStatus:100) ~[?:?]
	at net.minecraft.world.chunk.ChunkStatus.runGenerationTask(ChunkStatus:231) ~[?:?]
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17225(ThreadedAnvilChunkStorage:556) ~[?:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-4.0.26.jar:?]
	at net.minecraft.server.world.ThreadedAnvilChunkStorage.method_17224(ThreadedAnvilChunkStorage:550) ~[?:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1146) ~[?:?]
	... 11 more

Environment:

  • Minecraft 1.17.1
  • YUNG's API 1.17-Fabric-16
  • YUNG's BS 1.17-1.1.1
  • and many other mods

I am not sure how to reproduce this bug and I am not sure if it's 100% caused by this mod.

Complete Log

commented

Just wanted to add that I was not using /locate and that it does not happen everytime

commented

Probable duplicate of #39

commented

Yeah I know, but the root cause is the same bug. I've already encountered this & fixed the issue for Better Dungeons, I just gotta make the same fixes to Better Strongholds now.