ConcurrentModificationException
vgrynch opened this issue ยท 5 comments
Describe the Bug
I do not know if this will help to make this mod more reliable, but it seems to me some bad mod registering/initializing is used in Steam and Rails code. Unlike other ~300 mods I'm using, this mod causes random crashes of the server startup process: figured it out by a "Binary search" algorithm. The crash is always the same: Java concurrent modification exception happens in FML loader during mods loading. The mod it stops at is always random (in logs here its is Decorative Blocks, but it may be any other randomly), and the crash log is always the same.
An approximate ratio server starts normally vs server crashes is 4:1
This became a serious issue:
It hangs up the startup process in such a way that even some hosting services cannot detect that the server actually stalled on the startup and do not kill/restart it automatically, causing a big issue for automatic server restarting.
I'm adding here an example of the crash log I'm getting (see additional context), it's always the same. After that moment, all other mods (randomly), fail to load and the server hangs up.
Reproduction Steps
- Setup ArcLight server 1.19.2 with Forge
- Add create a mod and this mod, possibly some other mods - randomly, does not matter.
- Through several startups/restarts of the server, observe crashes during the startup process.
Expected Result
No random crashes during the startup when using Steam and Rails mod.
Screenshots and Videos
Crash Report or Log
No response
Operating System
Debian
Mod Version
1.4.3
Create Mod Version
0.5.1b
Minecraft Version
1.19.2
ModLoader and Version
Forge
Other Mods
Does not matter much as the issue was figured out clearly and it exactly points to this mod. We were using the Binary Search algorithm throughout several iterations and a lot of server restarts to be 100% sure what mod causes the issue. So we know that exactly removing this mod from the 300+ mods makes the server stop crashing during the startup.
Additional Context
---- Minecraft Crash Report ----
// I feel sad now :(
Time: 2023-08-25 08:24:42
Description: Mod loading error has occurred
java.lang.Exception: Mod Loading has failed
at net.minecraftforge.logging.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:55) ~[forge-1.19.2-43.2.21-universal.jar%23578!/:?] {re:classloading}
at net.minecraftforge.server.loading.ServerModLoader.load(ServerModLoader.java:39) ~[forge-1.19.2-43.2.21-universal.jar%23578!/:?] {re:classloading}
at net.minecraft.server.Main.main(Main.java:113) ~[server-1.19.2-20220805.130853-srg.jar%23573!/:?] {re:classloading,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B,pl:mixin:A}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
at net.minecraftforge.fml.loading.targets.CommonServerLaunchHandler.lambda$launchService$0(CommonServerLaunchHandler.java:29) ~[fmlloader-1.19.2-43.2.21.jar%23100!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:30) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-10.0.8.jar%2387!/:?] {}
at io.izzel.arclight.boot.application.ApplicationBootstrap.accept(ApplicationBootstrap.java:41) [arclight-forge-1.19.2-1.0.2.jar%2381!/:arclight-1.19.2-1.0.2-4a870b30] {}
at io.izzel.arclight.boot.application.ApplicationBootstrap.accept(ApplicationBootstrap.java:12) [arclight-forge-1.19.2-1.0.2.jar%2381!/:arclight-1.19.2-1.0.2-4a870b30] {}
at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) [bootstraplauncher-1.1.2.jar:?] {}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}
at io.izzel.arclight.boot.application.Main_Forge.main(Main_Forge.java:23) [arclight-forge-1.19.2-1.0.2.jar:arclight-1.19.2-1.0.2-4a870b30] {}
at io.izzel.arclight.server.Launcher.main(Launcher.java:18) [arclight-forge-1.19.2-1.0.2.jar:arclight-1.19.2-1.0.2-4a870b30] {}
A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------
-- Head --
Thread: main
Stacktrace:
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?] {}
-- MOD decorative_blocks --
Details:
Caused by 0: java.lang.reflect.InvocationTargetException
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19.2-43.2.21.jar%23575!/:?] {}
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19.2-43.2.21.jar%23574!/:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {re:mixin}
Caused by 1: java.lang.ExceptionInInitializerError
at lilypuree.decorative_blocks.DecorativeBlocks.<init>(DecorativeBlocks.java:22) ~[Decorative+Blocks-forge-1.19.2-3.0.0.jar%23432!/:3.0.0] {re:classloading}
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19.2-43.2.21.jar%23575!/:?] {}
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19.2-43.2.21.jar%23574!/:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {re:mixin}
Mod File: XXXXXXXXXXXXXXXXXXX/mods/Decorative+Blocks-forge-1.19.2-3.0.0.jar
Failure message: Decorative Blocks (decorative_blocks) has failed to load correctly
java.lang.reflect.InvocationTargetException: null
Mod Version: 3.0.0
Mod Issue URL: NOT PROVIDED
Exception message: java.util.ConcurrentModificationException
Stacktrace:
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1597) ~[?:?] {}
at java.util.HashMap$ValueIterator.next(HashMap.java:1625) ~[?:?] {}
at cpw.mods.modlauncher.LaunchPluginHandler.computeLaunchPluginTransformerSet(LaunchPluginHandler.java:68) ~[modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:64) ~[modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.8.jar%2387!/:?] {}
at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.4.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.4.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.4.jar:?] {}
at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.4.jar:?] {}
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?] {}
at lilypuree.decorative_blocks.registration.forge.ForgeRegistrationFactory$Provider.register(ForgeRegistrationFactory.java:107) ~[Decorative+Blocks-forge-1.19.2-3.0.0.jar%23432!/:3.0.0] {re:classloading}
at lilypuree.decorative_blocks.core.Registration.<clinit>(Registration.java:31) ~[Decorative+Blocks-forge-1.19.2-3.0.0.jar%23432!/:3.0.0] {re:classloading}
at lilypuree.decorative_blocks.DecorativeBlocks.<init>(DecorativeBlocks.java:22) ~[Decorative+Blocks-forge-1.19.2-3.0.0.jar%23432!/:3.0.0] {re:classloading}
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] {}
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] {}
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] {}
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] {}
at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] {}
at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:68) ~[javafmllanguage-1.19.2-43.2.21.jar%23575!/:?] {}
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19.2-43.2.21.jar%23574!/:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) ~[?:?] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373) ~[?:?] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) ~[?:?] {}
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) ~[?:?] {re:mixin,re:computing_frames}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) ~[?:?] {re:mixin}
Do you have some dev build with the fix, by chance? What Create version this update is planned for?
I'm pretty sure it's just that SnR is not yet updated to Create 0.5.1c+, at least a similar issue happens to me on 1.18.2.
No, it's different. I'm using Create 0.5.1.b - please see the first post information.