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

Game throws a error and server crashes if host dies whilst controlling a creature #6482

Closed Rokvach closed 3 years ago

Rokvach commented 3 years ago

Noticed in dev branch

I tried to reproduce this after the crash and I wasn't able to even though I did exactly same as before

Steps:

  1. Start a multiplayer campaign and leave the outpost
  2. Spawn a creature inside the sub and take control of it
  3. Die as the creature and wait for round to end (I was killed by a security bot)
  4. Notice that a error is thrown to the console and soon after the server process crashes

Error: image.png

Server crash report:

Barotrauma Dedicated Server crash report (generated on 26.8.2021 11:54:06)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

Game version 0.14.9.0 (ReleaseWindows, branch dev, revision 873018fecc)
Language: English
Selected content packages: Vanilla 0.9
Level seed: BastApep
Loaded submarine: Dugong (2C4F942B801D1DB70335ED8EF963668C)
Selected screen: Barotrauma.GameScreen
Server (Round had started)

System info:
    Operating system: Microsoft Windows NT 6.2.9200.0 64 bit

Exception: Object reference not set to an instance of an object. (System.NullReferenceException)
Target site: Void EndRound(System.String, System.Collections.Generic.List`1[Barotrauma.TraitorMissionResult], TransitionType)
Stack trace: 
   at Barotrauma.GameSession.EndRound(String endMessage, List`1 traitorResults, TransitionType transitionType) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameSession.cs:line 684
   at Barotrauma.Networking.GameServer.EndGame(TransitionType transitionType) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Networking\GameServer.cs:line 2564
   at Barotrauma.Networking.GameServer.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Networking\GameServer.cs:line 520
   at Barotrauma.GameMain.Run() in <DEV>\Barotrauma\BarotraumaServer\ServerSource\GameMain.cs:line 385
   at Barotrauma.Program.Main(String[] args) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Program.cs:line 58

Last debug messages:
   26.8.2021 11:54:06 - [26.8.2021 11:54:06]
  Saving banlist
   26.8.2021 11:54:06 - [26.8.2021 11:54:06]
  Ending the round...
   26.8.2021 11:54:06 - [26.8.2021 11:54:06]
  Ending round (no living players left)
   26.8.2021 11:54:05 - [26.8.2021 11:54:05]
  Ernie Meza unequipped Diving Knife
   26.8.2021 11:54:05 - [26.8.2021 11:54:05]
  Ernie Meza used Diving Knife on Crawler.
   26.8.2021 11:54:05 - [26.8.2021 11:54:05]
  Crawler has died (Cause of death: Lacerations)
   26.8.2021 11:54:04 - [26.8.2021 11:54:04]
  Ernie Meza used Diving Knife on Crawler.
   26.8.2021 11:54:03 - [26.8.2021 11:54:03]
  Ernie Meza used Diving Knife on Crawler.
   26.8.2021 11:54:02 - [26.8.2021 11:54:02]
  Ernie Meza used Diving Knife on Mudraptor.
   26.8.2021 11:54:01 - [26.8.2021 11:54:01]
  Ernie Meza used Diving Knife on Crawler.
   26.8.2021 11:54:00 - [26.8.2021 11:54:00]
  Ernie Meza used Diving Knife on Mudraptor.
   26.8.2021 11:53:59 - [26.8.2021 11:53:59]
  Ernie Meza used Diving Knife on Mudraptor.
   26.8.2021 11:53:58 - [26.8.2021 11:53:58]
  Ernie Meza used Diving Knife on Mudraptor.
   26.8.2021 11:53:57 - [26.8.2021 11:53:57]
  Ernie Meza used Diving Knife on Crawler.
Regalis11 commented 3 years ago

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/19107d0ec1923baa8e23580a45e84d9d39d7b3f7. The line in question only runs if all missions have been completed (or before the fix https://github.com/Regalis11/Barotrauma-development/commit/b00aae5, if there's no missions selected), that might've been why you couldn't repro it again.

Rokvach commented 3 years ago

I encountered a similar crash again when testing out the pet eating items ticket

  1. Start a multiplayer campaign and leave outpost (I had selected to only have 1 bot if that makes any difference)
  2. Spawn in a pet (I spawned Peanut)
  3. Take control of Pet
  4. Console throws the above error
  5. Server crashes

Also got this exception when trying to reproduce the issue a second time with the above steps image.png

Barotrauma Dedicated Server crash report (generated on 31.8.2021 12:49:44)

Barotrauma seems to have crashed. Sorry for the inconvenience! 

Game version 0.1500.0.0 (ReleaseWindows, branch dev, revision 9028924684)
Language: English
Selected content packages: Vanilla 0.9
Level seed: New SiberiaDrumskinny Linea
Loaded submarine: Dugong (2C4F942B801D1DB70335ED8EF963668C)
Selected screen: Barotrauma.GameScreen
Server (Round had started)

System info:
    Operating system: Microsoft Windows NT 6.2.9200.0 64 bit

Exception: Object reference not set to an instance of an object. (System.NullReferenceException)
Target site: Barotrauma.Submarine <GetLeavingSub>g__GetLeavingSubAtEnd|61_4(System.Collections.Generic.IEnumerable`1[Barotrauma.Character])
Stack trace: 
   at Barotrauma.CampaignMode.<GetLeavingSub>g__GetLeavingSubAtEnd|61_4(IEnumerable`1 leavingPlayers) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameModes\CampaignMode.cs:line 529
   at Barotrauma.CampaignMode.GetLeavingSub() in <DEV>\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameModes\CampaignMode.cs:line 0
   at Barotrauma.CampaignMode.GetAvailableTransition(LevelData& nextLevel, Submarine& leavingSub) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameModes\CampaignMode.cs:line 391
   at Barotrauma.MultiPlayerCampaign.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\GameSession\GameModes\MultiPlayerCampaign.cs:line 402
   at Barotrauma.GameSession.Update(Single deltaTime) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\GameSession\GameSession.cs:line 625
   at Barotrauma.GameScreen.Update(Double deltaTime) in <DEV>\Barotrauma\BarotraumaShared\SharedSource\Screens\GameScreen.cs:line 167
   at Barotrauma.GameMain.Run() in <DEV>\Barotrauma\BarotraumaServer\ServerSource\GameMain.cs:line 381
   at Barotrauma.Program.Main(String[] args) in <DEV>\Barotrauma\BarotraumaServer\ServerSource\Program.cs:line 58

Last debug messages:
   31.8.2021 12:49:44 - [31.8.2021 12:49:44]
  Saving banlist
   31.8.2021 12:49:44 - [31.8.2021 12:49:44]
  Console command "control Peanut" executed by Rokvach.
   31.8.2021 12:49:44 - Found multiple matching characters. Use "[charactername] [0-1]" to choose a specific character.
   31.8.2021 12:49:41 - [31.8.2021 12:49:41]
  Console command "spawn peanut cursor" executed by Rokvach.
   31.8.2021 12:49:36 - [31.8.2021 12:49:36]
  Console command "spawn peanut" executed by Rokvach.
   31.8.2021 12:49:31 - [31.8.2021 12:49:31]
  Console command "enablecheats" executed by Rokvach.
   31.8.2021 12:49:31 - Steam achievements have been disabled during this play session.
   31.8.2021 12:49:31 - Cheat commands have been enabled by "Rokvach".
   31.8.2021 12:49:27 - [31.8.2021 12:49:27]
  Rokvach: I'll set the course onwards!
   31.8.2021 12:48:55 - [31.8.2021 12:48:55]
  Lee Goodin: Like Jupiter, we are the ones...
   31.8.2021 12:48:52 - [31.8.2021 12:48:52]
  Lee Goodin: Second to sun, second to sun...
   31.8.2021 12:48:17 - [31.8.2021 12:48:17]
  Rokvach set the value "Channel" of the item "Headset" to "0".
   31.8.2021 12:48:07 - [31.8.2021 12:48:07]
  Round started.
   31.8.2021 12:48:07 - WARNING: Error when initializing a round: character "Lee Goodin" has not been given their initial items but has saved inventory data. Using the saved inventory data instead of giving the character new items.
Regalis11 commented 3 years ago

Fixed in https://github.com/Regalis11/Barotrauma-development/commit/3f106843409b29ac1f5ba9cb3890e2fbd3bdf14e

Rokvach commented 3 years ago

Tested, wasn't able to reproduce the issue anymore, seems to be working correctly. Closing.