FakeFishGames / Barotrauma

A 2D online multiplayer game taking place in a submarine travelling through the icy depths of Jupiter's moon Europa.
http://www.barotraumagame.com/
1.76k stars 406 forks source link

Crashes related to PhysicsBody.Enabled #159

Closed DifferentLevelDan closed 6 years ago

DifferentLevelDan commented 6 years ago

Crash report is from my live server. I have git cherry-pick'd commit 72e42bd257cb612896d0dea4fb1f420829536595

Reading the crash report, may be related to husk spawning or enabling physics on bodies that have been disposed.

Exact codebase my server is running: https://github.com/DifferentLevelDan/Barotrauma/tree/Dystopian

crashreport.txt

juanjp600 commented 6 years ago

12/14/2017 12:49:40 PM - FixtureList is null! This is what I was hoping we would see, thanks for testing this out. I'm not sure if it had to do with husk spawning or some bug in the FishAnimController, I'll be looking into it. We might need to add some extra stuff to that try-catch so we can determine what kind of character has this issue.

DifferentLevelDan commented 6 years ago

Another crash.

Round started, I noticed the debug console was up, scrolled up and found the try-catch's, saw some additional debug info I added, and went to control a mantis.

Game crashed right away.

crashreport.txt

if (body.FixtureList == null) { DebugConsole.NewMessage("FixtureList is null!", Color.Red); if (UserData is Limb limb) { DebugConsole.NewMessage($"Limb belongs to {limb.character.Name}", Color.Red); } }

DifferentLevelDan commented 6 years ago

Another crash, different stack trace from either of the previous. May be related to the ragdoll issue you found earlier.

Anecdotally, the server was up for 7 hours while I was at work. I came home, connected through another client (I was Jervis Clayton) and it crashed two rounds later. It seems like crashes are more common when I'm in-game on another client.

Maybe it's in my head. This is a terrible bug for reproducibility. I restarted the server and used the same level seed, ran through the mission, and it completed fine.

crashreport.txt

DifferentLevelDan commented 6 years ago

I've been getting more crashes, and I've noticed all (that I've seen) of them appear to be related to mantis limbs. I donno, maybe it's a lead.

12/16/2017 6:47:04 AM - Limb belongs to mantis 12/16/2017 6:47:04 AM - FixtureList is null! 12/16/2017 6:47:04 AM - PhysicsBody UserData: Barotrauma.Limb 12/16/2017 6:47:04 AM - Exception in PhysicsBody.Enabled = False (True) {Object reference not set to an instance of an object.} at FarseerPhysics.Dynamics.Body.set_Enabled(Boolean value) at Barotrauma.PhysicsBody.set_Enabled(Boolean value) in D:\GitHub\Barotrauma\Barotrauma\BarotraumaShared\Source\Physics\PhysicsBody.cs:line 177

EDIT: Just had a crash with a crawler. nvm

DifferentLevelDan commented 6 years ago

Crash can happen to players.

I noticed the log errors, so I ended the round to try to prevent a crash, as soon as the next round started it went down.

This time, it was a player, (Which may rule out the FishAnimController) so I'll include the crash log, since it was new.

crashreport.txt

DifferentLevelDan commented 6 years ago

Running with fixes from @juanjp600 server seems more stable. Got this crash twice now however.

crashreport.txt

DifferentLevelDan commented 6 years ago

Another crash related to Character.AnimController.Limbs being null.

crashreport.txt

DifferentLevelDan commented 6 years ago

Another crash related to Limbs being null

crashreport.txt

Regalis11 commented 6 years ago

Most likely related to ceaba2f

Regalis11 commented 6 years ago

I haven't encountered this problem since ceaba2f, so I'm pretty confident it's fixed now.