ReikaKalseki / Reika_Mods_Issues

The issue tracker for all of my mods - RotaryCraft, its addons, ChromatiCraft, and everything else.
46 stars 14 forks source link

[All versions of last two years] DAPI/CaveControl does not handle being fed invalid biome IDs gracefully #2250

Open Barhandar opened 4 years ago

Barhandar commented 4 years ago

1712 can be caused on an entirely new world and the world does not have any typical issues afterwards, so it's not corruption.

That is, it passes invalid value (created by CodeChickenLib 1.1.3.138 which as you can guess CANNOT be removed from packs because playing without NEI is unacceptable) along to vanilla/Forge code, which also doesn't handle this gracefully and crashes. Other mods don't crash (e.g. JourneyMap), they just report the invalid value. Chromaticraft might be unnecessary, I just don't know which vanilla biomes might trigger this crash and don't have the time to test them all.

Yes, it is in fact your mods (and Forge, but Forge ain't getting fixes so you might as well add a patch to DAPI, if you figure out how to fix this) at fault, you're missing out of bounds/null checks. Any other mod that'd generate invalid IDs would also make your code crash.

EDIT: Apparently older versions of CCL don't have this issue, which is how Reika himself didn't have the crash in dev environment, but they're also no longer available.

ReikaKalseki commented 4 years ago

Given that vanilla/forge cannot handle it either, it sounds like there is an underlying problem that needs fixing/identification, not just trying to make CaveControl ignore it and let something else crash instead.

Also, what exactly do you mean "invalid biome ID"?

Barhandar commented 4 years ago

Given that vanilla/forge cannot handle it either, it sounds like there is an underlying problem that needs fixing/identification

The problems are in CCL's fucked-up biome (mineshaftgen)/chunk (strongholdgen) handling + biome data being incompletely valid, as such crashes are normally caused by newbies' malformed first attempts at biomes.

Also, what exactly do you mean "invalid biome ID"?

The logs when I was crashing were showing "biome" IDs in five to seven digits (because IIRC it's an int that is stored as a byte), so an invalid ID is one above 255 (guaranteed) or below 0 (only when parsing an int since it's probably not stored as char and hence stored version would be -128 to 127 instead of 0 to 255).

and let something else crash instead.

NOTHING ELSE crashes. Only CaveControl actually reaches the crashing code.