CreativeMD / LittleTiles

GNU Lesser General Public License v3.0
159 stars 52 forks source link

Server hang when Starlight or Chipped are installed and loading a chunk containing a LittleTiles structure made with Chipped block #973

Open zFERDQFREZrzfq opened 1 month ago

zFERDQFREZrzfq commented 1 month ago

Hello,

I have a wierd server hang issue related to LittleTiles.

It does not happens for every structures, even when the structure contains Chipped block, but once it happens, it stays for good.

For exemple, I have a double-door structure with a frame containing some chipped:massive_cobblestone_bricks that initially triggered the bug, but after restoring a backup it suddently worked and kept working until I added a new unrelated structure (a window) made only of non-chipped blocks.

It looks like this happens only when all these conditions are met :

I tried to remove the following mods in an attempt to find a conflict, without effect :

After many long and tiring testing, I could finally load that chunk by removing both Starlight and Chipped.

The server runs :

Here is the top of the stacktrace from the server thread :

"Server thread" prio=5 Id=89 TIMED_WAITING on java.lang.String@87358b6
    at java.base@17.0.10/jdk.internal.misc.Unsafe.park(Native Method)
    -  waiting on java.lang.String@87358b6
    at java.base@17.0.10/java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_5667_(BlockableEventLoop.java:521)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:141)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerChunkCache.getChunkBlocking(ServerChunkCache.java:1772)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerChunkCache.m_7587_(ServerChunkCache.java:1664)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerChunkCache.mdd60d40$radium$lambda$getChunkOffThread$0$0(ServerChunkCache.java:1676)
    at TRANSFORMER/minecraft@1.20.1/net.minecraft.server.level.ServerChunkCache$$Lambda$45709/0x000000f005a7d310.get(Unknown Source)
    ...

And the watchdog stacktrace :

java.lang.Error: ServerHangWatchdog detected that a single server tick took 60.00 seconds (should be max 0.05)
    at jdk.internal.misc.Unsafe.park(Native Method) ~[?:?] {}
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:252) ~[?:?] {re:mixin}
    at net.minecraft.util.thread.BlockableEventLoop.m_5667_(BlockableEventLoop.java:521) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.fix_loop_spin_waiting.BlockableEventLoopMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:141) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.fix_loop_spin_waiting.BlockableEventLoopMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache.getChunkBlocking(ServerChunkCache.java:1772) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ChunkLoadDebug from mod cupboard,pl:mixin:APP:lithium.mixins.json:alloc.chunk_ticking.ServerChunkManagerMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.ServerChunkManagerMixin from mod radium,pl:mixin:APP:smoothchunk.mixins.json:ServerChunkCacheMixin from mod smoothchunk,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheMixin from mod littletiles,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheAccessor from mod littletiles,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin from mod pehkui,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ServerChunkCache_CurrentLoadingMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache.m_7587_(ServerChunkCache.java:1664) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ChunkLoadDebug from mod cupboard,pl:mixin:APP:lithium.mixins.json:alloc.chunk_ticking.ServerChunkManagerMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.ServerChunkManagerMixin from mod radium,pl:mixin:APP:smoothchunk.mixins.json:ServerChunkCacheMixin from mod smoothchunk,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheMixin from mod littletiles,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheAccessor from mod littletiles,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin from mod pehkui,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ServerChunkCache_CurrentLoadingMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache.mdd60d40$radium$lambda$getChunkOffThread$0$0(ServerChunkCache.java:1676) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ChunkLoadDebug from mod cupboard,pl:mixin:APP:lithium.mixins.json:alloc.chunk_ticking.ServerChunkManagerMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.ServerChunkManagerMixin from mod radium,pl:mixin:APP:smoothchunk.mixins.json:ServerChunkCacheMixin from mod smoothchunk,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheMixin from mod littletiles,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheAccessor from mod littletiles,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin from mod pehkui,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ServerChunkCache_CurrentLoadingMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache$$Lambda$45709/0x000000f005a7d310.get(Unknown Source) ~[?:?] {}
    at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] {}
    at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.fix_loop_spin_waiting.BlockableEventLoopMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_6367_(ServerChunkCache.java:541) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:connector_pre_launch:A}
    at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.fix_loop_spin_waiting.BlockableEventLoopMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache$MainThreadExecutor.m_7245_(ServerChunkCache.java:549) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:connector_pre_launch:A}
    at net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:139) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:modernfix-common.mixins.json:perf.fix_loop_spin_waiting.BlockableEventLoopMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache.getChunkBlocking(ServerChunkCache.java:1772) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ChunkLoadDebug from mod cupboard,pl:mixin:APP:lithium.mixins.json:alloc.chunk_ticking.ServerChunkManagerMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.ServerChunkManagerMixin from mod radium,pl:mixin:APP:smoothchunk.mixins.json:ServerChunkCacheMixin from mod smoothchunk,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheMixin from mod littletiles,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheAccessor from mod littletiles,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin from mod pehkui,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ServerChunkCache_CurrentLoadingMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.server.level.ServerChunkCache.m_7587_(ServerChunkCache.java:1664) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:cupboard.mixins.json:ChunkLoadDebug from mod cupboard,pl:mixin:APP:lithium.mixins.json:alloc.chunk_ticking.ServerChunkManagerMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.ServerChunkManagerMixin from mod radium,pl:mixin:APP:smoothchunk.mixins.json:ServerChunkCacheMixin from mod smoothchunk,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheMixin from mod littletiles,pl:mixin:APP:littletiles.mixins.json:server.level.ServerChunkCacheAccessor from mod littletiles,pl:mixin:APP:pehkui.mixins.json:compat117plus.compat1201minus.ServerChunkManagerMixin from mod pehkui,pl:mixin:APP:modernfix-forge.mixins.json:bugfix.chunk_deadlock.ServerChunkCache_CurrentLoadingMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.world.level.Level.m_6522_(Level.java:187) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:lithium.mixins.json:alloc.chunk_random.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:entity.collisions.intersection.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_entity_retrieval.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_tracking.block_listening.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_block_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_height.WorldMixin from mod radium,pl:mixin:APP:starlight.mixins.json:common.world.LevelMixin from mod starlight,pl:mixin:APP:citadel.mixins.json:LevelMixin from mod citadel,pl:mixin:APP:fabric-data-attachment-api-v1.mixins.json:AttachmentTargetsMixin from mod fabric_data_attachment_api_v1,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:WorldMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:littletiles.mixins.json:common.level.LevelAccessor from mod littletiles,pl:mixin:APP:littletiles.mixins.json:common.level.LevelMixin from mod littletiles,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.world.level.Level.m_6325_(Level.java:3051) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:lithium.mixins.json:alloc.chunk_random.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:entity.collisions.intersection.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_entity_retrieval.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_tracking.block_listening.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_block_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_height.WorldMixin from mod radium,pl:mixin:APP:starlight.mixins.json:common.world.LevelMixin from mod starlight,pl:mixin:APP:citadel.mixins.json:LevelMixin from mod citadel,pl:mixin:APP:fabric-data-attachment-api-v1.mixins.json:AttachmentTargetsMixin from mod fabric_data_attachment_api_v1,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:WorldMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:littletiles.mixins.json:common.level.LevelAccessor from mod littletiles,pl:mixin:APP:littletiles.mixins.json:common.level.LevelMixin from mod littletiles,pl:mixin:A,pl:connector_pre_launch:A}
    at net.minecraft.world.level.Level.m_8055_(Level.java:3543) ~[server-1.20.1-20230612.114412-srg.jar%23587!/:?] {re:computing_frames,pl:accesstransformer:B,pl:connector_pre_launch:A,re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:lithium.mixins.json:alloc.chunk_random.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:entity.collisions.intersection.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_entity_retrieval.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:util.block_tracking.block_listening.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.chunk_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_block_access.WorldMixin from mod radium,pl:mixin:APP:lithium.mixins.json:world.inline_height.WorldMixin from mod radium,pl:mixin:APP:starlight.mixins.json:common.world.LevelMixin from mod starlight,pl:mixin:APP:citadel.mixins.json:LevelMixin from mod citadel,pl:mixin:APP:fabric-data-attachment-api-v1.mixins.json:AttachmentTargetsMixin from mod fabric_data_attachment_api_v1,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:WorldMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:littletiles.mixins.json:common.level.LevelAccessor from mod littletiles,pl:mixin:APP:littletiles.mixins.json:common.level.LevelMixin from mod littletiles,pl:mixin:A,pl:connector_pre_launch:A}
zFERDQFREZrzfq commented 1 month ago

This one looks pretty tricky, because it's not systematic : It's not the first time I have it, and the only solution I have so far is to use backups.

I did a test with 2 backups of my world :

The first one is manually triggered right after the structure was finished, and there is no issue. The structure (a big double-door) is there, functionnal, and the chunk loads without issue.

The second backup is an automatic backup that hapenned around 30 min later, when noone was connected. On this one the chunk is failing. The oddity is that noone was online after the manual backup, so the server was in paused state (by MultiplayerServerPause mod) when the backup occured.

I rolled back to the manual backup and restarted the server, and surprizingly the issue does not reproduce so far. The only notable difference that comes to my mind is that on the bugged backup, I had cleared the Little Blueprint that I initially used for the door frame.

zFERDQFREZrzfq commented 1 month ago

So I downloaded my server world and removed all chunks aside of the buggy ones and tried that in singleplayer. The internal server hang is still present, which is a good thing since it allows me to do my mods tests locally.

So I started by removing ALL mods except CreativeCore and LittleTiles, and the issue is gone.

That means the issue is an incompatibility with another mod. Therefore I added back a few mods and tried to reload until I find the one that cause the bug.

In this case, it's Starlight. When it is present, the chunk containing LittleTiles structure cause a server hang. When I disable it, the chunk loads fine.

With the help of ModernFix's watchdog, I can confirm that the issue is the same that I had on the server (same stacktrace).

This incompatibility is not triggered by every LittleTile structure, but I observed that the smooth "Wall" and "Slope" built with the Little Chisel are more likely to trigger it.

zFERDQFREZrzfq commented 1 month ago

This is getting even wierder now...
I removed Starlight from both client and server but I still have the issue...
Ok so I had to remove both Starlight and Chipped to get rid of the issue.

zFERDQFREZrzfq commented 1 month ago

I prepared a region file containing only 4 chunks copied from my world, 2 of them are causing the issue (the ones where the wall is), so that you can test it if you wish. Steps to reproduce using the file :

The chunks are at 0, 0.

If you try it on singleplayer, the game will not crash, but it will stop ticking, so you can still move around, but chunk won't load anymore, the two that are triggering the issue will be invisible, entity won't move and command won't work and the logs will stop (you will not see anything revelant). You can't quit or close the game either, you will have to force-close it.

You can optionally install ModernFix to get the logs from it's watchdog (it will kick-in 40 seconds after the chunk fails to load).

r.0.0.mca.zip