Hardcore Ender Expansion

Hardcore Ender Expansion

2M Downloads

[INVALID] Crash when Chromaticraft V11a is present

Lebleus opened this issue ยท 77 comments

commented

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.

commented

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

commented

I am on Java 7.55 with no crashes.

commented

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?

commented

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).

commented

Can you try temporarily turning that off and seeing if the crash still happens?

commented

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.

commented

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.

commented

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..

commented

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

commented

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

commented

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

commented

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.

commented

WTF...does Forestry add sound categories or modify the system? @mezz

commented

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)

commented

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:

https://gist.github.com/dabaer/fae5090c1fb57cf7a654

commented

This officially makes no sense. Were this my issue tracker, the @#$&?! tag would be applied.

commented

Sounds like a non-transient Heisenbug.

commented

@ReikaKalseki were you able to reproduce this on your side? And are you able to see the other categories being added?

commented

Forestry doesn't have any sounds, doesn't use assembly, and does not alter anything other than its own config files.

commented

Title will have to do Reika :P

commented

No and yes respectively, but my pack does not contain HEE.

commented

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
.

commented

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.

commented

@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.

commented

Do either Forestry or HEE use EnumHelper anywhere at all? I am out of ideas.

commented

I wonder if EnumHelper is having some "leftover state" issue...

commented

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.

commented

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)

commented

@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

commented

@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.

commented

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);

commented

I tried setting B:enableMusic=false , still crashes. The other option ( removeVanillaDelay ) was already disabled.

commented

Now you know how I feel...

commented

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...

commented

If Forestry is somehow involved, what else do you both have in common?

commented

Right... what the fuck is going on then >.> it's not HEE music, if the configs are disabled EnumHelper doesn't trigger.

commented

No other ideas then.

commented

@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

commented

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.

commented

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.

commented

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.

commented

I can confirm the above method for whatever reason worked.

commented

commented

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.

commented

I've only had this issue when using Java 8. When using Java 7, it's fine.

commented

Unfortunately ~80% of our user base is on java 8 :<

commented

I can confirm Java 7 U79 working. Java 8 U73 crashes with the same error.

commented

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.

commented

@LexManos maybe?

commented

how do i enter If I remove all the keybinding data (key_*) from options.txt that thingi plz help me

commented

and what do i actully do if i find it

commented

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.

commented

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.

commented

The comment was removed, so nevermind..

commented

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

commented

@Tigertycoon And which mod also caused the same crash?

commented

Ok... it seems it's no other mod specifically but just the key thing again

commented

@ReikaKalseki any luck on the keybind front? is this a vanilla limitation (while we're on that note :P)?

commented

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.

commented

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.

commented

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

commented

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?

commented

I don't create new GameSettings anywhere, but I add keybindings.

commented

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.

commented

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;
}
commented

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 ๐Ÿ‘

commented

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.

commented

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

commented

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

commented

Clearly the conditions given are inaccurate. This is why I asked for confirmation.

commented

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

commented

Removing forestry OR HEE stops the bug from triggering.

commented

It may be had to the debugger, and the stack trace to see? Trace call all the methods if required.

commented

It is a config now, so just set it and be done with it.

commented

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.

commented

Resolved on CC side.