Skip to content
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

Concurrent block/item color registration causes crash #59

Closed
MundM2007 opened this issue Apr 19, 2023 · 9 comments
Closed

Concurrent block/item color registration causes crash #59

MundM2007 opened this issue Apr 19, 2023 · 9 comments

Comments

@MundM2007
Copy link

MundM2007 commented Apr 19, 2023

Describe the Crash
Added this mod to the modpack I'm working on is giving me this crash on Startup, it happens with different mods on each startup. (Once EvilCraft, once EvilCraft and Intergrated Dynamics and once AutoRegLib), without this mod the modpack works and doesn't crash. It seems to be happening on update checking. I've tried to add mods one by one (which I suspected to may cause this (mainly performance mods and mods they interact with)) without success.

Screenshots
image

Crash Report / log
latest.log
crash-2023-04-19_20.29.17-fml.txt

@MundM2007 MundM2007 changed the title [Crash] Startup Crash with java.lang.ArrayIndexOutOfBoundsException: 8192 [Crash: 1.16.5] Startup Crash with java.lang.ArrayIndexOutOfBoundsException: 8192 Apr 19, 2023
@embeddedt
Copy link
Owner

I am pretty sure this crash is not caused by ModernFix. One or more mods are incorrectly registering block/item colors on a background thread instead of the main thread like they are supposed to. ModernFix makes this crash more likely to occur because there is less unnecessary work being done on startup, and so more mods have the opportunity to be doing this concurrently. But I think it can happen without it as well.

One solution I will probably implement from my end is adding hooks into the vanilla code to allow mods to do this safely, since there are many out there that have this problem.


@Asek3 I think synchronizing access to the map in preRegisterColor is going to be needed, even though this is really a bug in other mods.
https://github.com/Asek3/Rubidium/blob/8bb8de0fb32381d3eee1c844a3f96e98926b7ae8/src/main/java/me/jellysquid/mods/sodium/mixin/core/model/MixinBlockColors.java#L6

Relevant issue: Someone-Else-Was-Taken/Periodic-Table-Reforged#71

@embeddedt embeddedt changed the title [Crash: 1.16.5] Startup Crash with java.lang.ArrayIndexOutOfBoundsException: 8192 Concurrent block/item color registration causes crash Apr 19, 2023
@embeddedt
Copy link
Owner

embeddedt commented Apr 19, 2023

Correction: I already fixed this for vanilla, the fix just doesn't seem to apply to Rubidium's version of the code because I didn't anticipate it being an issue. Should be a simple patch on my end.

@embeddedt
Copy link
Owner

modernfix.zip

I think this beta should fix your problem. This will be included in the next release.

embeddedt added a commit that referenced this issue Apr 19, 2023
@MundM2007
Copy link
Author

MundM2007 commented Apr 20, 2023

Hey, that fixed that issue! Thanks for the quick response and fixing it even though it isn't really caused by your mod.
Though i have found an incompatability with the spark mod (only spark and your new modernfix mod), crash report and log below:
(If I should open a new issue for this tell me and I will do so, also if this isn't caused by your mod again tell me and i will report to spark)
latest.log
crash-2023-04-20_20.21.05-fml.txt
Mod Link: https://www.curseforge.com/minecraft/mc-mods/spark

@embeddedt
Copy link
Owner

modernfix.zip

Thanks, fixed.

@Asek3
Copy link
Contributor

Asek3 commented Apr 21, 2023

So, is my interaction in Rubidium still needed? I mean compatibility with other mods maybe, not only ModernFix

@embeddedt
Copy link
Owner

I would suggest you make that map thread-safe, as otherwise modders will likely blame Rubidium since the crash happens within its mixin. But this is really a problem with other mods for calling this off the client thread in the first place.

@MundM2007
Copy link
Author

The modpack loaded up now! thanks! And I gotta say absolute awesome mod. It cut down loading times from 200 seconds to 100 seconds. Keep it going.

@embeddedt
Copy link
Owner

Thanks for the kind words. The latest release should also include this fix now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants