[INVALID] Crash when Chromaticraft V11a is present
Lebleus opened this issue ยท 77 comments
Hello, with the last version of HEE, the game can't be launched with the new version of Chromaticraft (V11a). It seems to be a bug with Sound Registering or something.
Here's the crash log.
java.lang.ArrayIndexOutOfBoundsException: 9 at java.util.EnumMap.put(Unknown Source) at java.util.EnumMap.put(Unknown Source) at Reika.DragonAPI.Libraries.ReikaRegistryHelper.addSoundCategory(ReikaRegistryHelper.java:292) at Reika.ChromatiCraft.ChromaClient.registerSounds(ChromaClient.java:148) at Reika.ChromatiCraft.ChromatiCraft.preload(ChromatiCraft.java:319) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) at net.minecraft.client.main.Main.main(SourceFile:148) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
I have also reported it to Reika (Chromaticraft Mod Dev').
I hope you will fix the problem quickly.
The crash has no information about HEE causing the issue, and I don't touch sound categories (only music types, which I've been doing for years anyways). Need info on your mod setup and replication with different HEE versions.
@ReikaKalseki any idea?
https://github.com/ReikaKalseki/DragonAPI/blob/master/Libraries/ReikaRegistryHelper.java#L292
As of v11 I add a custom sound category using Forge's EnumHelper. I know it works both in the dev environment and in my pack with some 180 mods, yet apparently HEE causes it to fail, not on the actual expansion of the enum, but the later reregistration of the volume settings, where Minecraft.getMinecraft().gameSettings.mapSoundLevels
does not have the expected size....five lines after it was explicitly assigned. Do you modify that (normally private, but ATed to public for me) field or the SoundCategory class in any way?
I don't touch mapSoundLevels nor SoundCategory, I only modify the music ticker and add a new entry to MusicType during SoundLoadEvent. All related code is in chylex.hee.sound (1.7.10-v1.8.5 branch).
Can you try temporarily turning that off and seeing if the crash still happens?
The crash doesn't happen no matter whether the music replacement is enabled or disabled. Running HEE 1.8.5, DragonAPI + CC V11a, Java8Checker v1.2. I asked OP to clarify their mod setup, can't replicate the issue with only those mods.
The issue on my tracker mentions previous HEE versions triggering the crash with 1.8.5 fixing it, whereas others contradicted that. Yet others said it was Java-version-specific.
Doesn't trigger with v1.8.4 either. Can't test on Java 7 because it's some portable probably 32bit version and I had to set java 8 to use 5 GB total just to get CC to run..
Perhaps it'll help if I upload my full crashlog? Since 1.8.5 crashes for me? Maybe my mod list might provide some insight or ?
crash-2016-02-27_13.10.41-client.txt
I was using java 8.31 when the crash happens.
I updated Java to latest version (8.73) and the crash happens again.
Also I tried these modpack configuration to have more informations about the crash ;
- Modpack alone => no crash
- Modpack + HEE => no crash
- Modpack + CC => no crash
- Modpack + HEE + CC => Crash
PS : I added my crash log file :
crash-2016-02-28_10.05.30-client.txt
Edit : I updated to V11b and the crash is still here. So I don't know where it comes from
I can confirm this. ^ Same exact thing with both HEE and CC installed. both HEE 1.8.4 and 1.8.5. Using newest version of CC v11b. If I take out either/or I do not get the crash. http://pastebin.com/bPC1RwAR
Again, cannot replicate with only HEE and CC installed, plus the crash has no direct or logical link to HEE. If nobody can confirm that this crash happens with only HEE and CC installed, I will close the issue and ask to find the smallest amount of mods required to replicate the crash (suspecting it's a combination of HEE, CC, and another mod) and reporting it to them.
WTF...does Forestry add sound categories or modify the system? @mezz
I said multiple times in the previous issue that I can only reproduce this crash with Forestry installed.
HEE+CC: https://gist.github.com/dabaer/b7f5d97fab4e10bb36ee (no crash)
Forestry+CC: https://gist.github.com/dabaer/9a2ea4a1684695ddd894 (no crash)
HEE+Forestry+CC https://gist.github.com/dabaer/796f3d031800b6be72a0 (crash)
It also looks like updating Forestry to latest fixed a previous crash while I was testing. I can now reproduce this crash with JUST HEE+Forestry+Reika et al:
This officially makes no sense. Were this my issue tracker, the @#$&?! tag would be applied.
@ReikaKalseki were you able to reproduce this on your side? And are you able to see the other categories being added?
Forestry doesn't have any sounds, doesn't use assembly, and does not alter anything other than its own config files.
I can confirm that updating Forestry from 4.2.5.53 to 4.2.9.57 did not fix the crash. Crash is still the same but here's the new updated crash file for more information.
crash-2016-03-01_06.45.34-client.txt
.
I think this issue may be related to some sort of config setting / conflict. I was getting the same crash, I tried backing up and deleting my options.txt and reloaded, game loaded fine without further problems.
@Teslapirate Problem is. At Reikas issue tracker. I was told basically the same thing. New Instance and still get the same crash. Though who knows at this point.
For anyone with the issue, does it still happen if you disable all music related stuff in the HEE config? There are two options I think, disable both.
Yea, for MusicType https://github.com/chylex/Hardcore-Ender-Expansion/search?utf8=%E2%9C%93&q=EnumHelper (mind that's master branch which is for HEE 2, so switch to 1.7.10-v1.8.5)
@chylex I'm gonna assume the two options would be B:enableMusic=false & B:removeVanillaDelay=false
The game still crashes with the same error. Here's another updated crash report just to see if anything change slightly.
crash-2016-03-02_07.49.11-client.txt
@ReikaKalseki Could something be loading GameSettings, and thusly the enum map before the EnumHelper has a chance to modify the value list? The implementation of EnumMap creates the internal array on construction.
Could something be loading GameSettings
I explicitly assign and overwrite the map myself a few lines before the crash, though:
Minecraft.getMinecraft().gameSettings.mapSoundLevels = new EnumMap(SoundCategory.class);
I tried setting B:enableMusic=false , still crashes. The other option ( removeVanillaDelay ) was already disabled.
I guess same as me, since apparently it's also an HEE issue somehow..
Eh, if the object changes in the middle of your code, could it be a multithreading issue? Cause the sound engine runs in a different thread... idk...
Right... what the fuck is going on then >.> it's not HEE music, if the configs are disabled EnumHelper doesn't trigger.
@ReikaKalseki You add an option in Music settings to configure Chromaticraft sound level right ?
If you disable the code which add this option, does the bug happen again ?
You have bees in Chromaticraft, if they have sounds (or a music) and forestry load before chromaticraft, the config option is not added yet so the game crashes
I know, it's a bit weird to understand but the crash itself is weird
Cause the sound engine runs in a different thread
The sound engine does, but the GameSettings do not, nor can anything else assign that map; I had to AT it just to be able to access it.
The dimension music and the bees have nothing to do with each other.
Also, no, there is no config, nor does Forestry loading first matter; GameSettings should initialize well before any mod gets to load.
A little additional information that might help: If I remove all the keybinding data (key_*) from options.txt, this crash does not occur. No keybinding data gets written on load/quit from then on until I change a key in the in-game menu. It writes all of the keys to options.txt, and this crash then occurs on subsequent loads.
More information: After further testing I've found there seems to be a numerical limit to how many key_ entries there can be in options.txt. 62 key_ entries, loads fine. 63 entries, crash. Does not seem to matter what entries there are as long as that numerical limit is obeyed.
This is completely incomprehensible. The very nature of JVMs is so that they should behave the same no matter what!
...I think we need someone much higher-level, who understands JVM internals.
@LexManos maybe?
how do i enter If I remove all the keybinding data (key_*) from options.txt that thingi plz help me
Uh... want to reopen the issue on CC tracker @ReikaKalseki? Apparently ^ it's now replicated without HEE, so I have even less of a fucking clue as to what might be happening.
I see noone clearly stating its occurrence being independent of the presence of HEE. I am just as clueless as you, and get the feeling that this is a classloading issue.
Sorry, but its right HEE is not the only mod thats causing this. I deleted my comment because i wanted to check which mods make the same crash happen too
@Tigertycoon And which mod also caused the same crash?
@ReikaKalseki any luck on the keybind front? is this a vanilla limitation (while we're on that note :P)?
What would I do or test? I am on Java 7 and do not have issues, and I doubt it would be a good idea to put limits on the keybind system.
I'm not sure, and I didn't mean to put limits on it, I was wondering if there was a known limit (as with items, biomes, potions, etc) in correlation with java 8, and if there was any way to shim it to get around that limit.
I... have an idea a mod with the name keybindingoverhaul exits. when first installed it clears all keys. Then minecraft should statt an you Can define new keys... But not to much
Also, is CC really the first mod to add a custom sound category? If so, that would surprise me; if not, how does it work for them?
I have never messed with the keybind system, but the only relation I can imagine between it and mapSoundLevels is that they are both stored in GameSettings.
....Unless....
Are either Forestry or HEE (or some core of either) creating new GameSettings objects?
Also, I just had another idea. Currently mapSoundLevels is an EnumMap. I could swap that out for a HashMap or similar, which would not be vulnerable to throwing OOBs. However, it would incur a performance penalty of unknown size, as EnumMaps are made and optimized specifically for enums over the general-purpose HashMap. Depending on the design of the sound handler/manager and how often the lookups/saves are done - preliminary checks indicate frequently, including at least once per sound event - that could have a nonzero impact. That said, I would be surprised if it were large enough to seriously impact framerate.
I hopefully have a workaround: Can someone confirm this to be the accurate set of triggers?
@SideOnly(Side.CLIENT)
private static boolean useSoundHashMap() {
return ModList.ENDEREXPANSION.isLoaded() && ModList.FORESTRY.isLoaded() && ReikaJVMParser.getJavaVersion(0) == 8 && KeyBinding.getKeybinds().size() >= 63;
}
I can't absolutely confirm it, but those will defenitely all return true in my currently erroring mod constellation and the testing I did, so from my perspective, yes it should be correct ๐
I need to know that all of them are necessary conditions. I do not want to check things that do not actually trigger the issue and thus lock out some cases.
I was able to reproduce it without HEE once though I was unable to find the mod that 'replaced' it...
If the log helps any, here it is: https://gist.github.com/Leguan12/bb3176e96690eca375c7/raw/d178606441951894afd52c978ed8cb654f53fce5/fml-client-latest.log_new
I can confirm the crash is still happening with Chromaticraft v12b. Updated Config here if anything. Java 8 U77. I'm guessing at this point it's a lost cause. I have no idea how to apply the above code.
crash-2016-03-30_17.04.04-client.txt
Clearly the conditions given are inaccurate. This is why I asked for confirmation.
I can confirm (with another huge set of mods -.-) that forestry + hee + cccraft + (keybindings?) together at least cause the issue. I'm checking whether forestry is necessary soon
It may be had to the debugger, and the stack trace to see? Trace call all the methods if required.
I'm assuming the config option is in the DragonAPI.cfg and is named "B:"Use HashMap for Sound Categories - Only use if necessary"=true" ? I also enabled this option in the Chromaticraft.cfg "B:"Use vanilla keybind system for ability selection GUI"=true" Just to be safe though I'm unsure if that destroyed something else or what.
If so, setting that gives a successful boot with HEE. A single player world was also successfully generated as well. Looking good so far.