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

Obscure physics-related crash with null fixture list #1109

Closed NilanthAnimosus closed 5 years ago

NilanthAnimosus commented 5 years ago

Description The crash appears to have been due to FixtureList being null on a physics body for a removed item, crashing the game from the physics library.

I am hazarding a guess based on information below it was due to a character changing their moving direction in the same update as an items use that removed the item, triggering process remove bodies before trying to rotate the item which body (and item) had been removed.

Steps To Reproduce Unknown, an AI was using a medical item on another AI as it simutainiously turned which it grabbed from a cabinet (Antibiotic glue)

Version Closed Alpha 0.8.9.3

Additional information

I looked through the code and found out the following:

Callstack information from visual studio:

    FarseerPhysics MonoGame.dll!FarseerPhysics.Dynamics.Body.SetTransformIgnoreContacts(ref Microsoft.Xna.Framework.Vector2 position = -505.8242  340.7642, float angle = 4.74076653) Line 804  C#
    FarseerPhysics MonoGame.dll!FarseerPhysics.Dynamics.Body.SetTransform(ref Microsoft.Xna.Framework.Vector2 position = -505.8242  340.7642, float rotation = 4.74076653) Line 768 C#
    FarseerPhysics MonoGame.dll!FarseerPhysics.Dynamics.Body.SetTransform(Microsoft.Xna.Framework.Vector2 position = -505.8242  340.7642, float rotation = 4.74076653) Line 784 C#
    Barotrauma.exe!Barotrauma.PhysicsBody.SetTransform(Microsoft.Xna.Framework.Vector2 simPosition = -505.8242  340.7642, float rotation = 4.74076653) Line 610 C#
>   Barotrauma.exe!Barotrauma.HumanoidAnimController.Flip() Line 1881   C#
    Barotrauma.exe!Barotrauma.HumanoidAnimController.UpdateAnim(float deltaTime = 0.0166666675) Line 492    C#
    Barotrauma.exe!Barotrauma.Character.UpdateAnimAll(float deltaTime = 0.0166666675) Line 1775 C#
    Barotrauma.exe!Barotrauma.GameScreen.Update(double deltaTime = 0.016666666666666666) Line 165   C#
    Barotrauma.exe!Barotrauma.GameMain.Update(Microsoft.Xna.Framework.GameTime gameTime = {Microsoft.Xna.Framework.GameTime}) Line 612  C#
    [External Code] 
    Barotrauma.exe!Barotrauma.Program.Main() Line 46    C#

Crash Location:

test 23

Red is the crashing character: image

Regalis11 commented 5 years ago

Haven't seen any reports of this in GameAnalytics since 8b1a63e, I believe it fixed the issue.