RelativityMC / raise-sound-limit-simplified

A mod that raises Minecraft sound sources limit in a simple way
MIT License
8 stars 2 forks source link

crash/kick #1

Open spaghettube opened 1 year ago

spaghettube commented 1 year ago

Describe the bug game crash or singleplayer kick

To Reproduce Steps to reproduce the behavior: its kind of random but just loading the world or even moving a bit may crash the game

Expected behavior not crashing

Screenshots no

Runtime info (please complete the following information):

Crash reports / logs https://pastebin.com/n83vdjCq

Other mods https://pastebin.com/WceV1BT1

Checklist

Additional context

im using loads of other mods, also im sure its your mod the culprit because ive tried binary splitting to scout out which one it was, even though the crash/kick is kind of inconsistent

ishland commented 1 year ago

Try adding this mod and provide error logs.

https://github.com/RelativityMC/unsafe-world-random-access-detector/actions/runs/3975315852

spaghettube commented 1 year ago
[21:50:01] [Render thread/INFO]: Animated skins loaded and ready to use!
[21:50:02] [Render thread/INFO]: Reloading entity icon resources...
[21:50:02] [Render thread/INFO]: Done!
[21:50:02] [Render thread/INFO]: Started 2 worker threads
[21:50:02] [Render thread/WARN]: Shader 953babc61b7d3bc9bfd95a62e6dc933dc8629aeb could not find uniform named subpixel_amount in the specified shader program.
[21:50:02] [Render thread/INFO]: Loaded 75 advancements
[21:50:02] [Render thread/INFO]: Found Player {Tigersenpai} with texture features in skin.
[21:50:02] [Netty Local Client IO #0/ERROR]: Exception occurred in netty pipeline
java.util.ConcurrentModificationException: ThreadLocalRandom accessed from a different thread (owner: Thread[Render thread,10,main], current: Thread[Netty Local Client IO #0,5,main])
    at com.ishland.uwrad.common.CheckedThreadLocalRandom.method_43156(CheckedThreadLocalRandom.java:32) ~[unsafe-world-random-access-detector-1.0.0.jar:?]
    at net.minecraft.class_6566.method_43055(class_6566.java:43) ~[client-intermediary.jar:?]
    at net.minecraft.class_638.handler$gfn000$onPlaySound(class_638.java:6648) ~[client-intermediary.jar:?]
    at net.minecraft.class_638.method_43207(class_638.java) ~[client-intermediary.jar:?]
    at net.minecraft.class_638.method_8465(class_638.java:464) ~[client-intermediary.jar:?]
    at net.minecraft.class_634.method_11146(class_634.java:1669) ~[client-intermediary.jar:?]
    at net.minecraft.class_2767.method_11895(class_2767.java:91) ~[client-intermediary.jar:?]
    at net.minecraft.class_2767.method_11054(class_2767.java:10) ~[client-intermediary.jar:?]
    at qouteall.imm_ptl.core.network.PacketRedirectionClient.handleRedirectedPacketFromNetworkingThread(PacketRedirectionClient.java:67) ~[imm_ptl_core-2.2.5-d20ad637191bf446.jar:?]
    at qouteall.imm_ptl.core.network.PacketRedirection.do_handleRedirectedPacketFromNetworkingThread(PacketRedirection.java:93) ~[imm_ptl_core-2.2.5-d20ad637191bf446.jar:?]
    at net.minecraft.class_2658.handler$gdc000$onHandle(class_2658.java:595) ~[client-intermediary.jar:?]
    at net.minecraft.class_2658.method_11457(class_2658.java) ~[client-intermediary.jar:?]
    at net.minecraft.class_2658.method_11054(class_2658.java:8) ~[client-intermediary.jar:?]
    at net.minecraft.class_2535.method_10759(class_2535.java:167) ~[client-intermediary.jar:?]
    at net.minecraft.class_2535.method_10770(class_2535.java:152) ~[client-intermediary.jar:?]
    at net.minecraft.class_2535.channelRead0(class_2535.java:50) ~[client-intermediary.jar:?]
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.local.LocalChannel.readInbound(LocalChannel.java:299) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.local.LocalChannel.finishPeerRead0(LocalChannel.java:445) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:50) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.channel.local.LocalChannel$5.run(LocalChannel.java:403) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) [netty-common-4.1.77.Final.jar:?]
    at io.netty.channel.DefaultEventLoop.run(DefaultEventLoop.java:54) [netty-transport-4.1.77.Final.jar:?]
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995) [netty-common-4.1.77.Final.jar:?]
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.77.Final.jar:?]
    at java.lang.Thread.run(Thread.java:833) [?:?]
[21:50:02] [Server thread/INFO]: Tigersenpai lost connection: Disconnected
[21:50:02] [Server thread/INFO]: Tigersenpai left the game
[21:50:02] [Netty Local Client IO #0/INFO]: Saving grave backup data
[21:50:02] [Server thread/INFO]: Disconnecting client Tigersenpai
[21:50:02] [Server thread/INFO]: Stopping singleplayer server as player logged out
[21:50:02] [Server thread/INFO]: Stopping server
[21:50:02] [Server thread/INFO]: Saving players
[21:50:02] [Server thread/INFO]: Saving worlds

this appeared in the log as soon as i tried to create a new singleplayer world, is this what you were looking for?

ishland commented 1 year ago

Yeah and a mod seems to be broken by some non-standard sound handling behavior of rsls. Try adding -Dmixin.debug.export=true to jvm flags, reproduce the crash then provide .mixin.out/class/net/minecraft/class_638.class

spaghettube commented 1 year ago

class_638.zip 3 different 638 class files came up, github wouldnt let me upload because of an unsopported file type

ishland commented 1 year ago

So it crashed in immersive portals at here. A possible workaround is to turn off enableCrossPortalSound. You may want to report to immersive portals.

spaghettube commented 1 year ago

got it, will do, thanks!

qouteall commented 1 year ago

@ishland How do you think this can be fixed?

ishland commented 1 year ago

@ishland How do you think this can be fixed?

In newer versions of Minecraft the vanilla sound packet from the server actually include a seed. I don't think regenerating a seed on client-side is a good idea because it is not going to be vanilla parity.

qouteall commented 1 year ago

I see. Forgot to update old code when mc upgrades. Should be fixed in the next version of ImmPtl.

qouteall commented 1 year ago

The packet handling should normally occur in client thread, so accessing the random won't cause an issue. However the packet is acually handled from networking thread. This may be caused by other optimization mods.

qouteall commented 1 year ago

As I tested, ImmPtl 2.4.9 with RLSL in MC 1.19.3 does not crash.

ishland commented 1 year ago

The packet handling should normally occur in client thread, so accessing the random won't cause an issue. However the packet is acually handled from networking thread. This may be caused by other optimization mods.

The packet handler is called from the networking thread as described here

However, you cannot draw the highlight box immediately. This is because the receiver is called on the netty event loop. The event loop runs on another thread, and you must draw the highlight box on the render thread.

qouteall commented 1 year ago

@ishland Yes I know that the packet apply is invoked on networking thread. In the vanilla packet handling code, NetworkThreadUtils.forceMainThread will throw an exception on networking thread and then add it into a queue to handle it on client thread. So the actual handling code is invoked on client thread.