Effective

Effective

5M Downloads

Client crash

kaxlabs opened this issue · 11 comments

commented

Perhaps same as #80

I have not encountered that crash yet, but it appears to be a problem with casting from double to int when sorting the List.

closeEntities.sort((o1, o2) -> (int) (o1.getPos().squaredDistanceTo(new Vec3d(this.x, this.y, this.z)) - o2.getPos().squaredDistanceTo(new Vec3d(this.x, this.y, this.z))));

I have tried some test code (intentionally causing overflow and underflow when casting from double to int), but could not pinpoint a definitive cause.

How about replacing the comparison function with Comparator.comparingDouble?
I built patched one and would like someone to try it.

commented

Perhaps same as #80

I have not encountered that crash yet, but it appears to be a problem with casting from double to int when sorting the List.

closeEntities.sort((o1, o2) -> (int) (o1.getPos().squaredDistanceTo(new Vec3d(this.x, this.y, this.z)) - o2.getPos().squaredDistanceTo(new Vec3d(this.x, this.y, this.z))));

I have tried some test code (intentionally causing overflow and underflow when casting from double to int), but could not pinpoint a definitive cause.

How about replacing the comparison function with Comparator.comparingDouble? I built patched one and would like someone to try it.

It happens somewhat consistently when I'm near this complex raid farm with a lot of water streams. If you attach the build I can try it.

commented

It happens somewhat consistently when I'm near this complex raid farm with a lot of water streams. If you attach the build I can try it.

Thank you for additional info. I'll test it by generating too much messed up water flow.

Here it is.
effective-1.2.1+patch-aeef858.jar.zip

commented

Yes it seems to crash when I am near my raid farm as well

commented

I see that it seems to crash near by raid farm.
I think it might be a good idea to be aware of thread-safes, as is the case on other issue boards, in my opinion. There are many reports of crashes with the tick method, or its auxiliary methods.

btw, I realize that replacing the comparison function misses the point of this issue, so I'm trying a new way to generate splash particles.
It still doesn't crash on my environment. Could someone please test it?
effective-1.2.1+patch-b78ec6f.jar.zip


Changes

  • register a new ParticleType class named SplashParticleType (extends DefaultParticleType)
  • use a custom structure class named SplashParticleInitialData

Solution:

  • do not call ClientWorld#getOtherEntities, no sorting, of course
  • refer the custom structure class when SplashParticle.DefaultFactory#createParticle was called

May cause:

  • generate oddly sized particles

Code is here: lonefelidae16/Effective/try/fix-splash-generator
Perhaps there are other useful solutions.
edit: No longer available.

commented

I see that it seems to crash near by raid farm. I think it might be a good idea to be aware of thread-safes, as is the case on other issue boards, in my opinion. There are many reports of crashes with the tick method, or its auxiliary methods.

btw, I realize that replacing the comparison function misses the point of this issue, so I'm trying a new way to generate splash particles. It still doesn't crash on my environment. Could someone please test it? effective-1.2.1+patch-b78ec6f.jar.zip

Changes

  • register a new ParticleType class named SplashParticleType (extends DefaultParticleType)
  • use a custom structure class named SplashParticleInitialData

Solution:

  • do not call ClientWorld#getOtherEntities, no sorting, of course
  • refer the custom structure class when SplashParticle.DefaultFactory#createParticle was called

May cause:

  • generate oddly sized particles

Code is here: lonefelidae16/Effective/try/fix-splash-generator Perhaps there are other useful solutions.

New crash with this build unsure what could've caused it:
latest.log
crash-2022-05-15_17.41.26-client.txt

commented

New crash with this build unsure what could've caused it: latest.log crash-2022-05-15_17.41.26-client.txt

Thanks for testing and reporting crashes. I know WaterfallCloudGenerators crashes at this time, but will be resolved with #83.
If I attach a build that includes all of these patches, could you like to try it?

commented

New crash with this build unsure what could've caused it: latest.log crash-2022-05-15_17.41.26-client.txt

Thanks for testing and reporting crashes. I know WaterfallCloudGenerators crashes at this time, but will be resolved with #83. If I attach a build that includes all of these patches, could you like to try it?

I'm subscribed to this thread and enjoy the mod, please attach builds whenever necessary.

commented

Thank you so much. I hope my code will be of help to someone.
effective-1.2.1+patch-efb1162.jar.zip

commented

Sorry for the delay, but this build hasn't caused any issues. I'd say it has fixed the crashes.

That sounds good. The crash report for this issue is the same as #97 . But I’m not sure what went wrong in the end; could it have something to do with Witch throwing potions...?
Anyway, I hope it gets merged upstream. Thank you again for testing and reporting back.

commented

Thank you so much. I hope my code will be of help to someone. effective-1.2.1+patch-efb1162.jar.zip

Sorry for the delay, but this build hasn't caused any issues. I'd say it has fixed the crashes.