Patbox / PolyFactory

A server side tech mode with storage, crafting and utility tech™
GNU Lesser General Public License v3.0
33 stars 5 forks source link

Crash with Incendium #17

Closed LambArchie closed 2 months ago

LambArchie commented 2 months ago

Hi, I've found that using this mod with Incendium (a nether worldgen datapack) causes crashes when the custom structures from that datapack generate.

Here is an example crash log https://mclo.gs/tx4J0KT with just PolyFactory + Incendium (and their dependencies)

Reproduction

Requirements

I can reproduce this issue consistently with only the following on Minecraft 1.20.6.

Steps

Easiest way I've found the easiest method is to use seed -5016 and once in game run /execute in minecraft:the_nether run tp 0 128 0. You will briefly see the nether portal texture as expected before being dumped into a black screen (expected since the chunks need generating) but never exit this black screen to show chunks, even after waiting a couple of minutes.

This is because the game's server has frozen, with the easiest way of checking this is by typing a message in chat and seeing how you never receive it's response, nor does it appear in the server logs. Additionally, Save and Quit to Title hangs on the loading bar meaning you have to force quit the game.

Alternative Steps

Another way I've found is by installing ModernFix and running /modernfix upgradeStructures. This also freezes the game server, like above but since you are still in the overworld you can see no more chunks are being generating. No special seed needed for this, anything works.

My Investigation

I've found that Spark continues to run in the background and the flamegraph show's it's just waiting for a task. Below is what it looks like with just Spark added on top of the minimal reproduction case (I've found the flamegraph looks different with ModernFix too but it fundamentally shows the same thing - it's stuck). image I've added the Spark Profiles.zip if you want to investigate them further. I've included two profiles, one with and without modernfix respectively.

Think it might have something to do with the datafix mixins in this mod since the logs + spark flamegraph too all point to that. However, I can't figure out why they are causing issues together since nothing in the code jumps out to me as incorrect (and I'm having some local dev issues currently so haven't been able to patch them out and see if it resolves the issue).

I know logs say incendium:castle/floors/1x1_l1 is the problem and it's corrupt but I've seen other structures in the logs too, just on other seeds when using the original reproduction steps.

Workaround

I have figured out a workaround for this issue, which is the following

Think this will need to be repeated on any Incendium update. Additionally, I'm not sure if ModernFix will expire this structure cache at some point but it's far better than nothing for now.

Believe this workaround will also resolve any other mod which places world structures and faces the same issue as Incendium, though I'm not sure why I'm having these problems with Incendium and not any of the other mods I'm running which do the same thing, especially since I'm running Terralith which is by the same people as Incendium and would have thought both would have the same problem.