CustomOreGen icon indicating copy to clipboard operation
CustomOreGen copied to clipboard

CustomOreGen: Detected a possible infinite loop during bezier interpolation. Please report this error.

Open Scratchman opened this issue 9 years ago • 11 comments

So, I'm reporting. http://pastebin.com/1EHpJk2c

There were 4 players on the server. Two of the players were on the main world, it's a pregenerated map without any ores.

The third player was on the mining dimension, we used the custom ore gen mod on this dimension to populate the ores, but the player was in an area of the map that was pregenerated 3 weeks ago and wasn't anywhere near new terrain.

The fourth player was in the nether in a new area that hadn;t been generated. Player 4 was the one that got disconnected and then this error was generated in the servers.log. We use COG in the nether too to generate nether quartz.

The error seems odd though because it mentions other mods that have nothing to do with the nether.

Scratchman avatar Feb 23 '16 03:02 Scratchman

Thanks for reporting it. This probably happened in the Nether. Magic Bees generates Infernal Hives there. Perhaps it placed a hive on the edge of a chunk, causing a block update and thus a chunk load in the adjacent chunk. Thus, there was recursive generation, but I'm not sure why that would break things. Without any steps to reproduce, not much more I can do for now. Will keep this as a record though.

lawremi avatar Feb 23 '16 07:02 lawremi

Remove farseek from your mods, it'll save you a lot of pains related to world generation.

LemADEC avatar Mar 19 '16 19:03 LemADEC

Actually, i had no problems at all from the streams mod. I've seen a few people mention that the streams mod causes lots of problems but i suspect that could be because of conflicts with other mods.

Streams generated just fine, even a couple of villages with streams going through them. I just wish that they would also generate on our mining dim since they make the landscape so interesting.

Scratchman avatar Mar 21 '16 19:03 Scratchman

Streams can generate up to 6000 blocks away from the initial chunks. Single player is manageable, multiplayer is next to impossible.

LemADEC avatar Mar 21 '16 21:03 LemADEC

I generated our servers current main world with the streams mod enabled and never saw any problems, streams look fine. We used the WorldBorder plugin to pregen the world out to +/- 4000 blocks from spawn and never saw a problem with stream generation. I suspect any problems servers have had with streams was probably caused by how it interacts with other mods.

You can see a dynmap of our main world with streams at http://map.imaginescape.tk/

Scratchman avatar Mar 22 '16 21:03 Scratchman

I didn't receive an error message, but while playing with CustomOreGen and a few other mods (including Farseek and Streams FWIW) in Singleplayer, the server thread would freeze and the game would be impossible to close gracefully. Usually this would happen when Mystcraft was profiling (generating chunks in the CONTROL dimension).

I inspected the process with the CPU sampler in JVisualVM and it showed that the server thread was spending the majority of its time inside of this function.

It appears that under certain circumstances, during bezier interpolation it can get stuck inside of the error compensation loop in the advance() function. I cloned the repository locally and removed the loop and this seems to have fixed the problem for me.

theJ8910 avatar Jul 20 '16 11:07 theJ8910

Please share the CPU sampler results.

LemADEC avatar Jul 20 '16 17:07 LemADEC

Here's a snapshot: snapshot

theJ8910 avatar Jul 21 '16 00:07 theJ8910

The Bezier interpolation fails to handle a derivation vector close or equal to 0 length. This results in a normalized vector with NaN has components, leading to an endless loop. There's probably an invalid parameter handling at the Vein level that triggers the issue. For now, fixing the interpolationcontext class did solve the issue for us.

LemADEC avatar Jul 20 '17 18:07 LemADEC

Would you please provide the fix as a PR?

lawremi avatar Jul 20 '17 19:07 lawremi

there you go, it's only for 1.7.10, shouldn't be hard to port to 1.10+.

LemADEC avatar Jul 20 '17 21:07 LemADEC