GregTechCE / GregTech

GregTech rewrite for modern versions of Minecraft
GNU Lesser General Public License v3.0
270 stars 150 forks source link

[BUG] Game Freezes When Opening Gregtech Machines GUI #1738

Open buckbeegb opened 2 years ago

buckbeegb commented 2 years ago

Describe the bug Game Freezes when opening Gregtech Machines' GUI. Not every time but frequently (and especially when the machine is currently processing) the game will freeze. I can press E & Esc and see the mouse cursor so something is still happening in the game, but the screen remains frozen. Since the graphics freeze but the game does not crash, I don't get any logs or crash reports to troubleshoot this issue with.

Versions Forge: GTCE: gregtech-1.12.2-1.17.1.770 Modpack: Has happened on Omnifactory, Nomifactory Release, & Nomifactory Dev builds Addons: This happened before I added any additional mods to the pack

Setup Playing Solo

Steps To Reproduce 1) Open Gregtech Machine GUI 2) Hit E or Esc

Expected behavior No Freezes

Screenshots If applicable, add screenshots to help explain your problem.

Additional context This only happens on single block machines and more frequently when the machines are mid process. This has never happened with multiblock machine interfaces or any buses on multiblock machines.

warjort commented 2 years ago

What you are describing is a problem in the logical server where it is either

These won't stop your logical client from working, but they will stop the server doing anything else until the problem resolves itself (if it ever does). NOTE: logical client and server are the same process for single player.

If it is looping we would need a thread dump to see where it is stuck. This will probably require you to install a jdk, unless you are using linux or know how to start minecraft from the command line for windows https://www.baeldung.com/java-thread-dump

For the stopped working possibility, we need to see the logs/latest.log. There will likely be some error, warning or info message that might hint at the problem. It could be further back in the log with you not noticing the problem until later when you access the broken block.

The multiblocks and singleblocks share a lot of the same code. I would guess it is luck which block you are seeing the problem on? But if you can be more specific about which block you first see the problem it might hint at what the problem is.

buckbeegb commented 2 years ago

2022-05-10-2.log.gz 2022-05-10-1.log.gz

2022-05-09-1.log.gz 2022-05-09-2.log.gz

Here's some logs

warjort commented 2 years ago

None of those show an error, but 2 of them show very long server ticks: 09-2

[22:01:08] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 1974150ms behind, skipping 39483 tick(s)

10-1

[15:04:28] [Server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 3241833ms behind, skipping 64836 tick(s)

That last one is a server tick of 54 minutes! They are meant to be 1/20th of a second.

Without a thread dump or error message its hard to say what is causing it.

This isn't even necessarily GTCE since anything could be causing a long server tick. You only think it is GTCE because the machines don't respond to GUI requests when this is happening. The GUI request asks for info from the server which will not respond due to the long tick.

warjort commented 2 years ago

You should post this bug report to NomiFactory. There is a good chance the problem is actually with one of the other mods in that pack and they may know of similar problems already experienced during testing?

Exaxxion commented 2 years ago

If the game is lagging to death then I would expect things to be unresponsive. Generate a spark sampler report using /spark sampler --interval 1 --timeout 30 and share it either in the Nomifactory discord (preferable) or in an issue ticket on Nomifactory's GitHub and we can try to figure out why you are encountering lag spikes.