AnOpenSauceDev / FastRandom

An optimized rewrite of Minecraft's RNG system, for Fabric!
Apache License 2.0
48 stars 3 forks source link

[BUG]: Chicken crash (mod conflict?) #60

Closed mxnmnm closed 2 months ago

mxnmnm commented 2 months ago

Does an issue already cover this?

Does your system support Faster Random?

Issue description.

Chickens randomly crash on my server. Neruina caught it so it didn't actually crash and I just put in the error it gave me.

Issue replication.

We just have multiple chickens crammed in a space for egg production and they very occasionally crash. Not sure how many other mods and such are involved.

Log File / Crash Report (if applicable)

https://gist.github.com/mxnmnm/4948b04b62efd7a7ca17b63f8e09ae74

AnOpenSauceDev commented 2 months ago

Looking at the source code for MC, it doesn't look like this is possible in vanilla (nothing that's relevant to the chicken calls with a bound that could become negative). This is likely a mod conflict of some sort, but I don't know what mods you have running.

mxnmnm commented 2 months ago

I am running A LOT of other mods and I'm not sure how to consistently reproduce the issue in a way that's testable within a reasonable amount of time :/

mxnmnm commented 2 months ago

Other than your standard binary search do you have any ideas of what mods might be causing this? I'll send a list of the mods I have but considering how many there are I'm not sure it'll be that helpful

mxnmnm commented 2 months ago

https://gist.github.com/mxnmnm/1cb1f8d192b17fa377b45cec84500c03

AnOpenSauceDev commented 2 months ago

I don't really know what it could be. All the stacktrace you have really says is "something called aiStep() on a chicken and made Faster Random generate a negative number." Using GitHub's code search showed nothing, so chances are it's a smaller/closed-source mod that I probably won't be able to track down, and Neruina doesn't give enough information on what is adding the offending nextInt() call.

In Minecraft's source, nextInt is only called once with a constant, positive bound within the whole method hierarchy for tickMovement()/aiStep(), so I'm sure that some lesser-known mod is causing this. I'm closing as 'not planned' for now, as this might not even be a bug with Faster Random itself.

mxnmnm commented 1 month ago

So some more interesting info: This only happens on dedicated servers

AnOpenSauceDev commented 1 month ago

The chicken logic would only occur server-side anyways. But this should be triggerable in singleplayer/LAN too.