DarkflameServer icon indicating copy to clipboard operation
DarkflameServer copied to clipboard

BUG: Ice Shurikens crashes WorldServer

Open TakumiKai25 opened this issue 3 years ago • 4 comments

Make sure you've done the following:

  • [X] I have checked that this issue has not already been reported.

  • [X] I have validated that this issue is not a syntax error of either MySQL or SQLite.

  • [X] I have pulled the latest version of the main branch of DarkflameServer and have confirmed that the issue exists there.

Issue Description

I found a bug and I don't know if it is just using the if ninja ice shurikens or others as well, but it causes the client to crash back to the login screen when throwing and hitting either nothing or the landscape not smashables or enemies and when you sign back in it reverts you to a previous location and doesn't save the progress.

Reproduction steps

Equip Ice Shurikens and throw hit landscape or miss

Expected Behavior

For the client to not crash and act as a miss like other ranged weapons

Environment

WSL

TakumiKai25 avatar Feb 01 '22 16:02 TakumiKai25

Looks like someone else had this previously with WSL 1; #245. No one was able to reproduce then, so I'm not sure how much we can do for this ticket without more information from your WorldServer and extra logging done.

NealSpellman avatar Feb 02 '22 21:02 NealSpellman

Can confirm this is indeed an issue. Reproduction steps as follows:

  • created a new character
  • set gm level 9
  • give self item 12659 (only works with ice shuriken atm)
  • set gmlevel 0
  • attack once at some terrain with the shuriken (i noticed against mountains and walls this happens 100% of the time)
  • crash after about 1 second

Im testing more items but right now, as far as I can tell, this only happens with the shuriken of ice and does happen in every world.
@averysumner since #245 was closed due to being unable to reproduce. I have noticed this happens with every terrain object (except rocket pads i believe. still testing that) at gm level 0. currently working on isolating the issue and will update with more info later Update: The crash happens in BasicAttackBehavior.cpp the first time bitStream->ReadBit() is called. Other findings: This appears to happen when the shuriken hits something before it times out. If the shuriken times out normally this crash does not happen. All other projectiles from my testing do not crash the world in the same way. The correctly make it all the way through the BasicAttackBehavior.cpp Handle() function without issue, even when in the same situation as the ice shurikens.

EmosewaMC avatar Feb 03 '22 05:02 EmosewaMC

Can confirm this is indeed an issue. Reproduction steps as follows: created a new character set gm level 9 give self item 12659 (only works with ice shuriken atm) set gmlevel 0 attack once at some terrain with the shuriken (i noticed against mountains and walls this happens 100% of the time) crash after about 1 second Im testing more items but right now, as far as I can tell, this only happens with the shuriken of ice and does happen in every world. @averysumner since #245 was closed due to being unable to reproduce. I have noticed this happens with every terrain object (except rocket pads i believe. still testing that) at gm level 0. currently working on isolating the issue and will update with more info later Update: The crash happens in BasicAttackBehavior.cpp the first time bitStream->ReadBit() is called. Other findings: This appears to happen when the shuriken hits something before it times out. If the shuriken times out normally this crash does not happen. All other projectiles from my testing do not crash the world in the same way. The correctly make it all the way through the BasicAttackBehavior.cpp Handle() function without issue, even when in the same situation as the ice shurikens.

Sounds like an overread on that bitstream to me.

codeshaunted avatar Feb 03 '22 08:02 codeshaunted

Could this title be updated to say it crashes the World Server? This doesn't crash the client but rather crashes the world server you are in

EmosewaMC avatar Feb 21 '22 19:02 EmosewaMC

An update to this. I have found the issue. It was related to undefined behavior sometimes not crashing the server, and sometimes crashing the server. The issue will be resolved in #862

EmosewaMC avatar Dec 01 '22 13:12 EmosewaMC