Crash when `WeightedPicker#search` called with argument out of expected range
See original GitHub issueThe following error crashed my server several times while generating terrain for minecraft:the_end
with Chunky
java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: The provided target value for entry selection must be less than or equal to the weight total
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.lang.IllegalArgumentException: The provided target value for entry selection must be less than or equal to the weight total
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145)
at net.fabricmc.fabric.impl.biome.WeightedPicker.search(WeightedPicker.java:79)
at net.fabricmc.fabric.impl.biome.WeightedPicker.pickFromNoise(WeightedPicker.java:56)
at net.fabricmc.fabric.impl.biome.TheEndBiomeData$Overrides.pick(TheEndBiomeData.java:132)
at net.minecraft.class_2169.handler$zzc000$getWeightedEndBiome(class_2169.java:546)
at net.minecraft.class_2169.method_38109(class_2169.java:82)
at net.minecraft.class_2826.method_38291(class_2826.java:200)
at net.minecraft.class_2791.method_38257(class_2791.java:393)
at net.minecraft.class_3754.method_38327(class_3754.java:134)
at net.minecraft.class_3754.method_38333(class_3754.java:124)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
... 6 more
A full crash report is available here
Is this an issue with the Fabric API, as it appears?
Issue Analytics
- State:
- Created a year ago
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Specified argument was out of the range of valid values ...
Visual Studio : 2012. Exception is thrown at the time of Showing Web Page Like, [ArgumentOutOfRangeException: Specified argument was out of the range...
Read more >C# Exception Guide: ArgumentOutOfRangeException
The ArgumentOutOfRangeException exception is thrown when the value of an argument is outside the expected range of values as defined by the ...
Read more >ArgumentException Class (System) - Microsoft Learn
ArgumentOutOfRangeException when the value of an argument is outside the range of acceptable values; for example, when the value "46" is passed as...
Read more >Specified argument was out of the range of valid values ...
You are trying to access an array or List and specifying an index value that is either negative or larger than the largest...
Read more >4. More Control Flow Tools — Python 3.11.1 documentation
To iterate over the indices of a sequence, you can combine range() and len() ... The actual parameters (arguments) to a function call...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It seems like some versions of perlin noise can in fact produce values >= 1: see https://www.gamedev.net/forums/topic/285533-2d-perlin-noise-gradient-noise-range--/
Finished work, was able to download/build fabric and run this through a debugger to inspect the
target
value & find a more reliable repro location.New tp command:
/execute in minecraft:the_end run tp @a -1312 64 -800
(should crash even w/ low chunk radius / should be in that chunk - I’ve updated my previous comment):The
target
variable in this case is1.0002144374246198
in my repro case… guessing it’s an issue w/ MC’s perlin noise implementation (probably some sort of error accumulation resulting in a tiny bit of overflow that causes results not to strictly be in the [0.0, 1.0] range all of the time).Seems not too uncommon in some seeds? (I’ve found multiple places this crashes in my seed) - so I’d say it’s a serious bug (definitely has stopped me from being able to play my world this weekend unless I fudge my own local build of fabric-api to add an allowed bias over 1.0)