Paragliders

Paragliders

4M Downloads

Server Crash on latest version

SirOMGitsYOU opened this issue ยท 5 comments

commented

Updated to latest version getting this crash.
crash-2021-05-09_11.27.36-server.txt

commented

I got the same error when creating a world, with no config present.

My debug log had the following lines before the exception:

[13May2021 10:36:54.118] [Server thread/DEBUG] [net.minecraftforge.common.ForgeConfigSpec$Builder$1/CORE]: List on key windSources is deemed to need correction. It is null, not a list, or an empty list. Modders, consider defineListAllowEmpty?
[13May2021 10:36:54.119] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key windSources was corrected from null to its default, [fire, campfire#lit=true, soul_campfire#lit=true].
[13May2021 10:36:54.119] [Server thread/DEBUG] [net.minecraftforge.common.ForgeConfigSpec/CORE]: The comment on key windSources does not match the spec. This may create a backup.
[13May2021 10:36:54.119] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key paraglidingConsumesStamina was corrected from null to its default, true.
[13May2021 10:36:54.119] [Server thread/DEBUG] [net.minecraftforge.common.ForgeConfigSpec/CORE]: The comment on key paraglidingConsumesStamina does not match the spec. This may create a backup.
[13May2021 10:36:54.120] [Server thread/WARN] [net.minecraftforge.common.ForgeConfigSpec/CORE]: Incorrect key runningAndSwimmingConsumesStamina was corrected from null to its default, false.
[13May2021 10:36:54.120] [Server thread/DEBUG] [net.minecraftforge.common.ForgeConfigSpec/CORE]: The comment on key runningAndSwimmingConsumesStamina does not match the spec. This may create a backup.
[13May2021 10:36:54.120] [Thread-2/DEBUG] [net.minecraftforge.fml.config.ConfigFileTypeHandler/CONFIG]: Config file paraglider-server.toml changed, sending notifies
[13May2021 10:36:54.122] [Thread-2/DEBUG] [net.minecraftforge.fml.config.ConfigFileTypeHandler/CONFIG]: Config file paraglider-server.toml changed, sending notifies
[13May2021 10:36:54.122] [Server thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/]: Exception caught during firing event: String index out of range: 4

I believe that in my case at least, Forge saved the default values to disk, got two change notifications for the changes for whatever reason, and two instances of parseWindSources ran in parallel, using the same (non-mutexed) regex matcher - and the concurrent modification caused the matcher to crash in Java's library code.

I'm pretty sure that this could be fixed by making the matcher a local variable instead of static.

I have some performance mods that might be messing with the config loading (e.g. Performant. Luckily, Performant allows disabling the automatic config reloading altogether.)

commented

I have a wind sources crash also. the sources are completely untouched versions of what was given when the mod was installed. nothing's been touched in it. :V however the modpack is quite extensive. details on all of them seem to be in the log and stuff. But it's the latest version you've got on curseforge from back in september.
crash-2021-05-14_04.48.53-server.txt

No crashes or issues on client.

commented

As Jasu pointed out, the issue is very likely to be caused by shared matcher instance. ModConfigEvent has two variations, Loading and Reloading. Loading is posted on server thread but Reloading is posted on a thread created by NightConfig library, which could be the source of this issue. In that case, replacing shared matcher instance will get rid of most of the issue. At least the game crashing part.

But as long as ModConfigEvent event can be ran in parallel, parsing config values at event handler could induce race condition and stale values might get written into field. To prevent this, I will defer parsing config value when Reloading event is posted. Loading event seems to be posted on server thread so it should be fine... I hope.

While testing, I discovered windSources config actually doesn't allow empty lists which isn't very intuitive. Also any values that cannot be parsed is removed completely in config which I don't like either. I will include changes on these behavior along with the fix.

I initially thought about delaying the shipment for fix until feature development is done, but three issue reports piling up in span of five days probably means I shouldn't do that. I will release a new version including fix for this issue plus bunch of other janks that fixed a few months ago.

Lastly, maybe not that important, but I failed to verify the issue itself. It works just fine on my machine. [Insert programmer joke here] For similar reason I can't really validate the fix which is not a best thing to do. Please call me again if something still goes wrong with new patch. I'm also not sure about why the issue started happening all of a sudden, since the problematic code existed for over half a year and now there's new crash reports coming every two days.

commented

yay for heisenbugs.

anyways, I will give it another try on my server then in a little while and hope for better results. :)

commented

That seems quite an error. Does the crash keeps happening? Also, can you provide windSources config value in the server config?