Spectrum

Spectrum

2M Downloads

[BUG] Crash in Deeper Down

armuell opened this issue · 9 comments

commented

Describe the bug
The game crashes when exploring the deeper down

To Reproduce
The crash has occurred twice so far, once about 5 seconds after first entering the dimension. Another an hour or 2 later of gameplay while exploring

Expected behavior
The game not to crash

Mod version
1.19.2

Crash Report
If it is a crash bug add your crash log here
crash-2023-12-07_16.32.37-server.txt
crash-2023-12-07_01.02.43-server.txt

commented

java.lang.IllegalStateException: Accessing LegacyRandomSource from multiple threads

We aren't even using legacy_random_source. Or are we? Hmmm.

Stacktrace:
at net.minecraft.server.MinecraftServer.tickWorlds(MinecraftServer.java:875)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:819)
at net.minecraft.IntegratedServer.tick(IntegratedServer.java:98)

EDIT: Love your world name <3

commented

Adding uwrad to your pack can help isolate this https://modrinth.com/mod/uwrad

commented

Yea just from reading the crash report I could tell it wasn't going to be very useful. I didn't know about uwrad, I'll add it to my pack and go exploring again to see if I can get another crash with an update crash report.

commented

I've been unable to get another crash to occur. I decided to recreate the world and try and fly around in spectator to see if I could force it to happen but still nothing. I noticed that my log had a lot of exception stack traces and uwrad was in them so I'll upload it here.

latest.log

Might be an issue with create? I can't tell if the exceptions in this log and the 2 original crashes are related or not but they didn't appear in my log until uward was added?

Either way the 2 crashes were rare and did't cause any issues with the world, I loaded back in just fine both times and kept playing without issues. So if nothing comes of this issue feel free to close.

commented

i've also had the "Accessing LegacyRandomSource from multiple threads" crash happen multiple times to me, though it isn't common or reliable. i also have no idea what's triggering it, besides that it always happens in the deeper down, usually when i'm exploring new land. i also was able to load back in and play without issues immediately afterwards in all cases. i'll include a crash log too, in case it helps.
crash-2023-10-04_19.32.58-server.txt

commented

I've been unable to get another crash to occur. I decided to recreate the world and try and fly around in spectator to see if I could force it to happen but still nothing. I noticed that my log had a lot of exception stack traces and uwrad was in them so I'll upload it here.

latest.log

Might be an issue with create? I can't tell if the exceptions in this log and the 2 original crashes are related or not but they didn't appear in my log until uward was added?

Either way the 2 crashes were rare and did't cause any issues with the world, I loaded back in just fine both times and kept playing without issues. So if nothing comes of this issue feel free to close.

Seeing a few sussy things in that log.

11:58:13] [Worker-Main-2/ERROR]: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: Worker-Main-2)
Possible solutions: Find possible causes in the stack trace below and report to the corresponding mod authors 

java.util.ConcurrentModificationException: ThreadLocalRandom accessed from a different thread (owner: Server thread, current: Worker-Main-2)
	at com.ishland.uwrad.common.CheckedThreadLocalRandom.handleNotOwner(CheckedThreadLocalRandom.java:51) ~[unsafe-world-random-access-detector-1.1.0.jar:?]
	at com.ishland.uwrad.common.CheckedThreadLocalRandom.isSafe(CheckedThreadLocalRandom.java:38) ~[unsafe-world-random-access-detector-1.1.0.jar:?]
	at com.ishland.uwrad.common.CheckedThreadLocalRandom.method_43156(CheckedThreadLocalRandom.java:82) ~[unsafe-world-random-access-detector-1.1.0.jar:?]
	at net.minecraft.class_6566.method_43048(class_6566.java:33) ~[client-intermediary.jar:?]
	at de.dafuqs.spectrum.registries.SpectrumRegistries.getRandomTagEntry(SpectrumRegistries.java:38) ~[spectrum-1.7.2-deeper-down.jar:?]
	at de.dafuqs.spectrum.entity.entity.LizardEntity.method_5749(LizardEntity.java:130) ~[spectrum-1.7.2-deeper-down.jar:?]
	at net.minecraft.class_1297.method_5651(net/minecraft/class_1297.java:1806) ~[client-intermediary.jar:?]
	at net.minecraft.class_1299.method_17839(net/minecraft/class_1299.java:492) ~[client-intermediary.jar:?]
	at net.minecraft.class_156.method_17974(net/minecraft/class_156.java:539) ~[client-intermediary.jar:?]
	at net.minecraft.class_1299.method_5892(net/minecraft/class_1299.java:491) ~[client-intermediary.jar:?]
	at net.minecraft.class_3499.method_17916(net/minecraft/class_3499.java:423) ~[client-intermediary.jar:?]
	at net.minecraft.class_3499.port_lib$createEntityIgnoreException$porting_lib_accessors_$md$ff377f$0(class_3499.java) ~[client-intermediary.jar:?]
	at io.github.fabricators_of_create.porting_lib.mixin.common.accessor.StructureTemplateAccessor.port_lib$createEntityIgnoreException(StructureTemplateAccessor.java) ~[porting_lib_accessors-2.1.1096+1.19.2-7d4e584a7f5a0c67.jar:?]
	at net.minecraft.class_3499.addEntitiesToWorld(io/github/fabricators_of_create/porting_lib/mixin/common/StructureTemplateMixin.java [porting_lib_base.mixins.json]:107) ~[client-intermediary.jar:?]
	at net.minecraft.class_3499.handler$zeo000$porting_lib_base$port_lib$place(io/github/fabricators_of_create/porting_lib/mixin/common/StructureTemplateMixin.java [porting_lib_base.mixins.json]:61) ~[client-intermediary.jar:?]
	at net.minecraft.class_3499.method_15172(net/minecraft/class_3499.java:348) ~[client-intermediary.jar:?]
	at net.minecraft.class_3781.method_16626(class_3781.java:127) ~[client-intermediary.jar:?]
	at net.minecraft.class_3790.method_27236(class_3790.java:89) ~[client-intermediary.jar:?]
	at net.minecraft.class_3790.method_14931(class_3790.java:85) ~[client-intermediary.jar:?]
	at net.minecraft.class_3449.method_14974(class_3449.java:99) ~[client-intermediary.jar:?]
	at net.minecraft.class_2794.method_38265(net/minecraft/class_2794.java:429) ~[client-intermediary.jar:?]
	at com.google.common.collect.ImmutableList.forEach(ImmutableList.java:422) ~[guava-31.0.1-jre.jar:?]
	at net.minecraft.class_2794.method_12102(net/minecraft/class_2794.java:428) ~[client-intermediary.jar:?]
	at net.minecraft.class_2806.method_20613(net/minecraft/class_2806.java:145) ~[client-intermediary.jar:?]
	at net.minecraft.class_2806.method_12154(net/minecraft/class_2806.java:292) ~[client-intermediary.jar:?]
	at net.minecraft.class_3898.method_17225(net/minecraft/class_3898.java:679) ~[client-intermediary.jar:?]
	at com.mojang.datafixers.util.Either$Left.map(Either.java:38) ~[datafixerupper-5.0.28.jar:?]
	at net.minecraft.class_3898.method_17224(net/minecraft/class_3898.java:673) ~[client-intermediary.jar:?]
	at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
	at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
	at net.minecraft.class_3900.method_17634(class_3900.java:62) ~[client-intermediary.jar:?]
	at net.minecraft.class_3846.method_16907(class_3846.java:91) [client-intermediary.jar:?]
	at net.minecraft.class_3846.method_16900(class_3846.java:146) [client-intermediary.jar:?]
	at net.minecraft.class_3846.run(class_3846.java:102) [client-intermediary.jar:?]
	at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1395) [?:?]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) [?:?]
	at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?]
	at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?]

Seems like there are a lot of concurrent access errors around the lizards. On a side note uwrad squelches the error to logs instead of letting you crash while it's installed

commented

this.setColor(color == null ? SpectrumRegistries.getRandomTagEntry(SpectrumRegistries.INK_COLORS, InkColorTags.ELEMENTAL_COLORS, world.random, InkColors.CYAN) : color);

Looks like it doesn't like having world.random called here?

commented

So I think calling worlds random here is the problem, it looks like the nbt read is happening in a worker thread so when the lizard color gets selected that can yield a crash.

commented

That is one of the weirdest bugs yet. Good find, thank you lots!