Facepunch / sbox-issues

175 stars 12 forks source link

S&box crashes when restarting game #4038

Closed yuberee closed 1 year ago

yuberee commented 1 year ago

Describe the bug

This has been going on for a few weeks and seems to be a problem with just our game. Restarting the game instantly crashes S&box, nothing appears on the logs.

Here is my SteamID: 76561198049395102 Hoping it's a skill issue but I wish it told me what it was.

To Reproduce

  1. Clone the repo: https://github.com/Small-Fish-Dev/Bomb-Survival
  2. Start a game
  3. Restart the game
handsomematt commented 1 year ago

The crash says it's a stack overflow, usually caused by while(true) { }

yuberee commented 1 year ago

I'll have a look at any recursion I missed that happens when restarting a game. I'll get back in 5 minutes

handsomematt commented 1 year ago

You could try checking out a commit from a few weeks ago from before this started happening and step through commits till you get the crash.

yuberee commented 1 year ago

I've reverted to a commit that was months old when we weren't crashing and it still crashed. I've gone ahead and deleted everything except for the GameManager and the Main Menu, I finally managed to figure out what it was. https://github.com/Small-Fish-Dev/Bomb-Survival/commit/d5662838e887c6045886df0c99d10f3db9c517a9

This line in particular: scenePanel = Add.ScenePanel( sceneWorld, Vector3.Zero, Rotation.Identity, Game.Preferences.FieldOfView, "scenePanel" ); works when first booting up the game, but causes the crash when restarting. Not sure if I should open a different issue.

Also safe to say, I didn't come back in 5 minutes.

PolSpock commented 1 year ago

Duplicate of https://github.com/sboxgame/issues/issues/4023 Ask me the next time @yuberee 😎🗿

yuberee commented 1 year ago

Yes seems to be related, good find. I'll go ahead and close this issue.