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.73k stars 402 forks source link

[Unstable V0.10.6.2] Crash when switching characters in singleplayer, while UnequipUnnecessaryItems is being called #4104

Closed Rokvach closed 3 years ago

Rokvach commented 3 years ago

Reported by JP on Discord

No known ways to reproduce, speculating that its caused when switching to a bot while the bot is in process of unequipping a diving suit or a fire extinguisher when they don't need it anymore.

Barotrauma Client crash report (generated on 18/10/2020 9:48:23 PM)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

1E4A3A190F10A70CF5A29E72B544DED1

Game version 0.10.6.2 (ReleaseWindows, branch release, revision 7e1ccc3326)
Graphics mode: 1920x1080 (BorderlessWindowed)
VSync ON
Language: English
Selected content packages: Vanilla 0.9, Malaco_1.068, Carrack, Defiant D_1.45, Riptide
Level seed: FalgaKennet Linea
Loaded submarine: Malaco_1.095_cu (5CD47E1B33430992E22F5B493E81484A)
Selected screen: Barotrauma.GameScreen
SteamManager initialized

System info:
    Operating system: Microsoft Windows NT 10.0.18363.0 64 bit
    GPU name: Intel(R) UHD Graphics 630
    Display mode: {Width:1920 Height:1080 Format:Color AspectRatio:1.7777778}
    GPU status: Normal

Exception: Object reference not set to an instance of an object. (System.NullReferenceException)
Target site: Void UnequipUnnecessaryItems()
Stack trace: 
   at Barotrauma.HumanAIController.UnequipUnnecessaryItems()
   at Barotrauma.HumanAIController.Update(Single deltaTime)
   at Barotrauma.Character.UpdateAll(Single deltaTime, Camera cam)
   at Barotrauma.GameScreen.Update(Double deltaTime)
   at Barotrauma.GameMain.Update(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.DoUpdate(GameTime gameTime)
   at Microsoft.Xna.Framework.Game.Tick()
   at Microsoft.Xna.Framework.SdlGamePlatform.RunLoop()
   at Microsoft.Xna.Framework.Game.Run(GameRunBehavior runBehavior)
   at Microsoft.Xna.Framework.Game.Run()
   at Barotrauma.Program.Main(String[] args)

Last debug messages:
[18/10/2020 9:18:38 PM] Generating an outpost for the start of the level... (Location: Falga, level type: LocationConnection)
[18/10/2020 9:18:22 PM] (Msg) RelayNetWorkStatus:  avail=OK  config=OK  anyrelay=OK   (OK)
[18/10/2020 9:18:22 PM] (Msg) Ping location: iad=84+8,atl=98+9/97+8,ord=152+15/104+8,okc=152+15/121+8,sea=149+14/145+8,lax=156+15/148+8,eat=167+16/149+8,lim=154+15,par=168+16/161+8,fra=239+23/170+8,gru=246+24/228+8,sgp=309+30/326+8
[18/10/2020 9:18:22 PM] (Msg) Ping measurement completed
[18/10/2020 9:18:21 PM] (Debug) Destroying relay 'sof#1 (139.45.193.10:27015)' because initial_ping_timeout
[18/10/2020 9:18:18 PM] Setting the maximum amount of players to 42 failed due to exceeding the limit of 16 players per server. Using the maximum of 16 instead.
[18/10/2020 9:18:18 PM] (Debug) Destroying relay 'sof#4 (139.45.193.10:27018)' because initial_ping_timeout
[18/10/2020 9:18:17 PM] (Warning) SteamNetworkingSockets lock held for 17.6ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:17 PM] (Warning) SteamNetworkingSockets lock held for 8.5ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:17 PM] (Warning) SteamNetworkingSockets lock held for 6.0ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:16 PM] (Msg) Relay sea#31 (205.196.6.66:27045) is going offline in 82 seconds
[18/10/2020 9:18:16 PM] (Verbose) Communications with routing cluster 'sea' established.
[18/10/2020 9:18:15 PM] (Debug) Destroying relay 'sea#119 (205.196.6.148:27041)' because initial_ping_timeout
[18/10/2020 9:18:15 PM] (Debug) Destroying relay 'sof#3 (139.45.193.10:27017)' because initial_ping_timeout
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 6.5ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 5.6ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 9.3ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 9.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 12.0ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 6.8ms.  (Performance warning).  ServiceThread,SendUDPacket
[18/10/2020 9:18:14 PM] (Warning) SteamNetworkingSockets lock held for 8.1ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 14.0ms.  (Performance warning).  ServiceThread,SendUDPacket(x3)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 13.5ms.  (Performance warning).  ServiceThread,SendUDPacket(x3)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 12.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x3)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 8.0ms.  (Performance warning).  ServiceThread,SendUDPacket(x2)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 67.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x6)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 38.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 105.0ms.  (Performance warning).  ServiceThread,IRawUDPSocket::Close(x2),SendUDPacket(x9),OpenRawUDPSocketInternal(x2)
[18/10/2020 9:18:13 PM] (Debug) Destroying relay 'sof#2 (139.45.193.10:27016)' because initial_ping_timeout
[18/10/2020 9:18:13 PM] (Debug) Destroying relay 'sea#96 (205.196.6.148:27018)' because initial_ping_timeout
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 47.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x5)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 52.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x9)
[18/10/2020 9:18:13 PM] (Warning) SteamNetworkingSockets lock held for 59.3ms.  (Performance warning).  ServiceThread,SendUDPacket(x9)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 63.2ms.  (Performance warning).  ServiceThread,SendUDPacket(x7)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 45.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 47.2ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 70.1ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 47.9ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 56.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x9)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 82.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 55.6ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:12 PM] (Warning) SteamNetworkingSockets lock held for 57.3ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 48.5ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 50.4ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 44.5ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 39.8ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 187.9ms.  (Performance warning).  ServiceThread,RecvUDPPacket,SendUDPacket(x13)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 43.4ms.  (Performance warning).  ServiceThread,SendUDPacket(x8)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 77.9ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 51.3ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:11 PM] (Verbose) Communications with routing cluster 'tyo1' established.
[18/10/2020 9:18:11 PM] (Verbose) Communications with routing cluster 'syd' established.
[18/10/2020 9:18:11 PM] (Warning) SteamNetworkingSockets lock held for 41.6ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'waw' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'tyo' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'vie' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'sgp' established.
[18/10/2020 9:18:10 PM] (Warning) SteamNetworkingSockets lock held for 50.7ms.  (Performance warning).  ServiceThread,SendUDPacket(x10)
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'sto2' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'maa' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'sto' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'scl' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'par' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'ord' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'okc' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'mad' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'lux' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'lim' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'lhr' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'lax' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'jnb' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'iad' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'hkg' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'gru' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'fra' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'eat' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'dxb' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'bom' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'atl' established.
[18/10/2020 9:18:10 PM] (Verbose) Communications with routing cluster 'ams' established.
[18/10/2020 9:18:10 PM] (Warning) SteamNetworkingSockets lock held for 546.2ms.  (Performance warning).  ServiceThread,OpenRawUDPSocketInternal(x30),SendUDPacket(x30)
[18/10/2020 9:18:10 PM] (Msg) RelayNetWorkStatus:  avail=Attempting  config=OK  anyrelay=Attempting   (Performing ping measurement)
[18/10/2020 9:18:10 PM] (Msg) Performing ping measurement
[18/10/2020 9:18:10 PM] (Msg) Got SDR network config.  Loaded revision 283 OK
[18/10/2020 9:17:52 PM] Attempting to open ALC device "OpenAL Soft on Speakers (Realtek(R) Audio)"
[18/10/2020 9:17:50 PM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean
[18/10/2020 9:17:50 PM] Loaded languages: English, German, French, Russian, Polish, Brazilian Portuguese, Castilian Spanish, Latinamerican Spanish, Simplified Chinese, Traditional Chinese, Japanese, Turkish, Korean
itchyOwl commented 3 years ago

I don't see how switching the character could cause the crash. Pity that the report doesn't have the line numbers. I went through the code and didn't spot anything that would crash. But clearly there is something. I also tried to switch to characters that were in middle of returning a suit or an extinguisher. Couldn't repro.

mrjpjr commented 3 years ago

I was on a scooter outside right beside the sub when I heard knife sounds and saw on the chat "What do you think you are doing?" I thought to myself: "Is the bot attacking one of the pets with a knife?" so I switched to see what was going on, but the game crashed before I could see anything.

Rokvach commented 3 years ago

I wasn't able to reproduce the issue still, tested by going for a swim with a scooter and switching characters as well as ordered a bot to fight intruders gave him knifes and spawned in a crawler and switched to the bot while it was attacking and done attacking the crawler.

itchyOwl commented 3 years ago

Just keep the eyes open for the issue and hope that we can get another log with the line numbers. Then it should be easier to fix. It doesn't seem to be too frequent, as it's so difficult to reproduce.

Regalis11 commented 3 years ago

@itchyOwl Got a crash report with line numbers now: https://github.com/Regalis11/Barotrauma/issues/4252

itchyOwl commented 3 years ago

Fixed in Regalis11/Barotrauma-development@4ba5647.

Thanks to the almost correct line numbers, I was able to reproduce the crash.

Steps: 1) control a bot and equip a diving suit 2) spawn the bot outside so that it won't take the suit off (don't use the hold position command) 3) type "freecam" 4) teleport the bot inside a ruins 5) if the hull inside the ruins is flooding, lower the water level using the console command "water" and pressing right mouse button. 6) the game should crash when the bot is not fully in water: image (8).png

Rokvach commented 3 years ago

Tested, working correctly. Closing.