-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] ConcurrentModificationException causing server crash #1256
Comments
Thank you creating this issue. What I can see from crash log is cascade world loading. When we ask for Redstone power it has to check additional blocks which in this case lay in not loaded chunk which means loading it. When new chunk is loaded all tileentities are loaded and some of ours starts checking for Redstone signal... This happens 3x times and dies on fourth which probably happens because chunk being loaded is same as first one on which whole circle of getting Redstone strength started. (But that does not make sense as that one is already loaded and should be cached) I am seeing this for first time and all our MetaTileentities are calling this so it definitely can't be common problem. And it is probably not even caused just by GTCE. But it is in combination with other mod probably one that is doing something with world loading order (maybe optimizing it? but that is just guessing). I don't even have suggestion for this as there is not enough data. |
Hello there. Somehow i got to get the same error, altho it happened on a server with sponge, but i cloned the DIM119 (void) that was causing the crash to a singleplayer with base OmniFactory 1.2.2, and getting the same issue: Some extra info about mine: With mcedit i removed some chunks and it didnt crash, so it's definetely some tileentity not corrupted thingy. |
the zip provided does not contain the level.dat from the world containing the world seed and block ids |
There is no need for that. Here are the steps for reproducing the error:
|
Thank you for providing us with new crashlog which is not that much convoluted and with reproduction steps. It still looks like Forge/Vanilla MC bug to me but further analysis is required. |
A pleasure. Anything you need you can ping me on Discord to not spam the issue ^^ |
There is also this issue: FTBTeam/FTB-Interactions#1306 |
Update: this seems to happen when you chunkload the inside of Compact machines via an external mod and somehow a GT machine might be at the other side of one of its tunnels this can happen. A workaround is to set chunk loading to false in the FTBUtilities and then deselect that chunk inside of the CM. I suspect this might as well happen when you do not completely chunkload your base. e.g. GT machine is chunkloaded, the cable, pipe or whatever connecting to it is not or vice versa. /edit: more weirdness, in that compact machine of ours was no gregtech machine or block at all. |
@Enjoyed Do you know exactly what was in the chunk that caused the crash? You said you removed a chunk and it fixed the issue |
Since I was asked about this on a different bug report, I decided to do a little investigation.
This is basically following a cable that leads to a machine in a new chunk. There is no duplicate loading of a chunk. i.e. minecraft/forge is loading the chunk and then iterating over the tile entities. While it is doing that, something is adding or removing a tile entity. Some of things in that chunk are some gregtech machines including a pyrolase oven, cables, enderio conduits with facades, AE2 interfaces, a couple of small (non-gregtech) fluid tanks and a fluid garbage bin. |
GT is getting the blame because it is the one that initiates the chunk load. What is weird, is that to actually see what is in the chunk, I modified getRedstonePower() to always return 0 and not AND, when I put back the original gregtech jar, the world also loaded fine. Just being able to load and save the world once fixed the problem, This suggests to me that something in that world save is in a corrupt state? Or there is an inconsistent state between 2 of the saved chunks/regions? |
Yes, i spent a whole evening with mcedit removing chunk -> restoring -> removing chunk... (Even deleting by Y axis.), but the issue wasn't with a single chunk. Hope this information helps you |
One thing I will add to the discussion, is that if this cable were hundreds of blocks long. The stacktrace would be massive with lots of "recursive" calls to getRedstonePower() along the cable and this also would lead to many chunk loads, possibly cascading into other cables that need to be followed. Moving this initialisation of the redstone power caching into something more lazy during the initial tick of each block would stop this from happening and would also remove any potential of a cascade of chunk loading requests. The redstone power cache could even potentially be saved in the tile/cover state to be used if the neighbouring block is not loaded? That is what vanilla does with its redstone. e.g. see the comparator's ouput signal. |
Someone else had this error. They were changing ID's of things around, and when they changed the ID of a cable that was already in the world to something else, they had this crash. I think it might be related to the script-generated cables, or its related to meta shifts in cables. Their crashlog: https://paste.gg/p/anonymous/5714aa7dcfab4725ab3c119783313daf |
https://drive.google.com/drive/folders/17CzVzFgOxW7Dt3SdHObIjXyb8ZVSLadp?usp=sharing |
ive been getting this error too, on a pretty old world that's been through a lot of mod changes and such; it's only began manifesting relatively recently, though. crash log attached, let me know if you need world files or a mod list or anything. |
Your crash report shows the same issue, something is adding, replacing or removing a tile entity during chunk loading. I still think the correct fix is move that initialisation of the redstone cache from onLoad() into the first tick handling. This does not mean the real problem will be fixed (whatever is changing/corrupting the tile entities). |
We have an open PR to fix this, shame that people still have to have corrupt worlds from this when it's such an easy fix |
If you are referring to #1623 see my critique in #1648 As I understand the issue, the actual error is caused by other mods triggering tile entity changes during chunk loading which runs into CCME errors in forge's rewritten tile entity loading code. Forge does not expect these updates. Where GTCE comes into play is that it wrongly gets blamed because it is the one that starts the chunk loading. You can argue that the way GTCE starts the chunk loading is wrong since it leads to cascading chunk loading and this makes the error more likely (more chunks being loading means more concurrency*). But this does not change the fact that GTCE is not the one causing the underlying error. The above mentioned PRs attempt to remove the cascading chunk loading by deferring the redstone cache calculation. (*) When I use concurrency here I don't mean multiple threads but instead it is CCME errors caused by data structures getting modified from within loops over their iterators. |
Another way to fix it would be introduce a core mod or mixin that modifies forge's tile entity loading code. A simple change would be to make it iterate over a cloned copy of the data structure. A more complicated alternate would be to somehow trap where the data structure is incorrectly modified during chunk loading and report the offending block/mod so the real error can be fixed. |
- Easy patch, but doesn't exactly fix the root of the issue - But seems like entities loading were done in the same way...
Remove patch from GregTechCE/GregTech#1623 Add mod "CensoredASM" 4.4 - Add its config file * disable reuseBucketQuads - Among other things, should patch the cause of the redstone first-tick bug throwing a ConcurrentModificationException in rare circumstances on world loads (GregTechCE/GregTech#1256). Add mod MixinBooter 2.0 (library/dependency)
Describe the bug
Server crashes on startup with java.util.ConcurrentModificationException after calling gregtech.api.util.GTUtility.getRedstonePower(GTUtility.java:686)
Versions
Forge: 14.23.5.2847
GTCE: 1.10.0.546
FTB Interactions: 2.0.9 https://www.curseforge.com/minecraft/modpacks/ftb-interactions
Setup
Server
Steps To Reproduce
Tried running from multiple backups and to have forge remove any erroring blocks but get the same resultss
Expected behavior
Server should start up without crashing
Additional context
Crash log: https://pastebin.com/Xd8T6hhB
Another users issue on FTB Interactions issue tracker: FTBTeam/FTB-Interactions#1263
Tried updating GregtechCE to newest version, running on multiple backups, setting forge to remove erroring entities and tile entities. All with the same results.
The text was updated successfully, but these errors were encountered: