Skip to content

RT's CreateRenderTarget() fails causing client crash on goonstation #2396

@amylizzle

Description

@amylizzle

When connecting to a local instance of goon using

#define GOTTA_GO_FAST_BUT_ZLEVELS_TOO_SLOW 1  
#define IM_REALLY_IN_A_FUCKING_HURRY_HERE 1  

in __build.dm, a client crash occurs when the player join window, changelog window, and character creation windows should be shown.

The crash seems to be related to the creation of a tooltip browse() window.

Two errors occur. First when the window is created, a non-fatal error occurs leaving the _renderTargets dictionary in a bad state

Robust.Shared.Utility.DebugAssertException: new framebuffer has bad status 0
   at Robust.Shared.Utility.DebugTools.Assert(Boolean condition, AssertInterpolatedStringHandler& message) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Shared/Utility/DebugTools.cs:line 215
   at Robust.Client.Graphics.Clyde.Clyde.CreateRenderTarget(Vector2i size, RenderTargetFormatParameters format, Nullable`1 sampleParameters, String name) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.RenderTargets.cs:line 195
   at Robust.Client.Graphics.Clyde.Clyde.GLContextWindow.CreateWindowRenderTexture(WindowData reg) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs:line 329
   at Robust.Client.Graphics.Clyde.Clyde.GLContextWindow.WindowResized(WindowReg reg, Vector2i oldSize) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs:line 130
   at Robust.Client.Graphics.Clyde.Clyde.SendWindowResized(WindowReg reg, Vector2i oldSize) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.Events.cs:line 118
   at Robust.Client.Graphics.Clyde.Clyde.GlfwWindowingImpl.ProcessEventWindowSize(EventWindowSize ev) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Windowing/Glfw.Events.cs:line 218
   at Robust.Client.Graphics.Clyde.Clyde.GlfwWindowingImpl.ProcessEvent(EventBase evb) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Windowing/Glfw.Events.cs:line 77
   at Robust.Client.Graphics.Clyde.Clyde.GlfwWindowingImpl.ProcessEvents(Boolean single) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Windowing/Glfw.Events.cs:line 20

then the UI draw thread attempts to use the bad render target and causes a crash

An unhandled exception of type 'System.Collections.Generic.KeyNotFoundException' occurred in System.Private.CoreLib.dll: 'The given key 'ClydeHandle 112' was not present in the dictionary.'
   at System.ThrowHelper.ThrowKeyNotFoundException[T](T key)
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Robust.Client.Graphics.Clyde.Clyde.RtToLoaded(IRenderTarget rt) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.RenderTargets.cs:line 279
   at Robust.Client.Graphics.Clyde.Clyde.GLContextWindow.BindWindowRenderTarget(WindowId rtWindowId) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/GLContext/GLContextWindow.cs:line 148
   at Robust.Client.Graphics.Clyde.Clyde.BindRenderTargetImmediate(LoadedRenderTarget rt) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.RenderTargets.cs:line 291
   at Robust.Client.Graphics.Clyde.Clyde.BindRenderTargetFull(LoadedRenderTarget rt) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.RenderTargets.cs:line 263
   at Robust.Client.Graphics.Clyde.Clyde.RenderInRenderTarget(RenderTargetBase rt, Action a, Nullable`1 clearColor) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.HLR.cs:line 454
   at Robust.Client.Graphics.Clyde.Clyde.RenderHandle.RenderInRenderTarget(IRenderTarget target, Action a, Nullable`1 clearColor) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.RenderHandle.cs:line 133
   at Robust.Client.UserInterface.UserInterfaceManager.Render(IRenderHandle renderHandle) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/UserInterface/UserInterfaceManager.Layout.cs:line 149
   at Robust.Client.Graphics.Clyde.Clyde.Render() in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/Graphics/Clyde/Clyde.HLR.cs:line 99
   at Robust.Client.GameController.<StartupContinue>b__65_1(Object sender, FrameEventArgs args) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/GameController/GameController.cs:line 257
   at Robust.Shared.Timing.GameLoop.Run() in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Shared/Timing/GameLoop.cs:line 307
   at Robust.Client.GameController.ContinueStartupAndLoop(DisplayMode mode) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 163
   at Robust.Client.GameController.GameThreadMain(DisplayMode mode) in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 148
   at Robust.Client.GameController.<>c__DisplayClass107_0.<Run>b__0() in /home/wnv9567/workspace/OpenDream/RobustToolbox/Robust.Client/GameController/GameController.Standalone.cs:line 107

From what I can tell, a number of failures happen in Robust.Client.Graphics.Clyde.Clyde.CreateRenderTarget() which I believe can only be explained by a bad GL context. GL.GenFramebuffer() returns a handle of 0, which it should not do, and this causes later commands to fail.

This super needs replicating, it's not out of the realm of possibility that this is a driver error on my system.

Replication Steps

  1. clone goonstation (several commits affected, but this one definitely: https://github.com/goonstation/goonstation/tree/b6963fff3a94179e8f48db9b7af3c7de7fb8a1c8)
  2. edit __build.dm and uncomment the first two options
  3. probably need the rustg compiling for x64
  4. compile
  5. run
  6. join client
  7. observe crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientInvolves the OpenDream clientCodebase: GoonstationRelating to the Goonstation codebasehelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions