SDL port broken
Posted: Mon Aug 01, 2016 9:56
Yesterday, I saw that there is a GPL-fork of GzDoom now, which I really like. So I wanted to try it out on my Ubuntu 16.04 box. However, the SDL port is broken, and the Git maintainer redirected me here. First graphics card info (as needed here)
OpenGL Information (from glmark2)
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce GT 630/PCIe/SSE2
GL_VERSION: 4.5.0 NVIDIA 364.19
Now, the bug:
Thread 1 "gzdoom" received signal SIGSEGV, Segmentation fault.
0x000000000071708c in FGLRenderer::RenderView (this=0x0, player=0x1087140 )
at src/gl/scene/gl_scene.cpp:905
905 gl_RenderState.SetVertexBuffer(mVBO);
Stuff from valgrind, with backtraces:
==4949== Invalid read of size 8
==4949== at 0x71704A: FGLRenderer::RenderView(player_t) (gl_scene.cpp:897)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0x12822d10 is 16 bytes inside a block of size 120 free'd
==4949== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0x86BB0A8: XFree (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x869BA1A: XFreeEventData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA06AF: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5AA1907: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949== by 0x78F407: TryRunTics() (d_net.cpp:1834)
==4949== by 0x785332: D_DoomLoop() (d_main.cpp:1010)
==4949== Block was alloc'd at
==4949== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0xAF428F9: ??? (in /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0)
==4949== by 0x86BAEB4: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B7B7E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B8554: _XEventsQueued (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x8699E49: XFlush (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA17C1: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949==
==4949== Invalid write of size 8
==4949== at 0x717085: FGLRenderer::RenderView(player_t) (gl_scene.cpp:902)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0x12822d10 is 16 bytes inside a block of size 120 free'd
==4949== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0x86BB0A8: XFree (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x869BA1A: XFreeEventData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA06AF: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5AA1907: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949== by 0x78F407: TryRunTics() (d_net.cpp:1834)
==4949== by 0x785332: D_DoomLoop() (d_main.cpp:1010)
==4949== Block was alloc'd at
==4949== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0xAF428F9: ??? (in /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0)
==4949== by 0x86BAEB4: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B7B7E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B8554: _XEventsQueued (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x8699E49: XFlush (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA17C1: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949==
==4949== Invalid read of size 8
==4949== at 0x71708C: FGLRenderer::RenderView(player_t) (gl_scene.cpp:905)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0xc0 is not stack'd, malloc'd or (recently) free'd
Stepping through the code, it appears that the global variable GLRenderer is never initialized on SDL.
OpenGL Information (from glmark2)
GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce GT 630/PCIe/SSE2
GL_VERSION: 4.5.0 NVIDIA 364.19
Now, the bug:
Thread 1 "gzdoom" received signal SIGSEGV, Segmentation fault.
0x000000000071708c in FGLRenderer::RenderView (this=0x0, player=0x1087140 )
at src/gl/scene/gl_scene.cpp:905
905 gl_RenderState.SetVertexBuffer(mVBO);
Stuff from valgrind, with backtraces:
==4949== Invalid read of size 8
==4949== at 0x71704A: FGLRenderer::RenderView(player_t) (gl_scene.cpp:897)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0x12822d10 is 16 bytes inside a block of size 120 free'd
==4949== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0x86BB0A8: XFree (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x869BA1A: XFreeEventData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA06AF: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5AA1907: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949== by 0x78F407: TryRunTics() (d_net.cpp:1834)
==4949== by 0x785332: D_DoomLoop() (d_main.cpp:1010)
==4949== Block was alloc'd at
==4949== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0xAF428F9: ??? (in /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0)
==4949== by 0x86BAEB4: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B7B7E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B8554: _XEventsQueued (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x8699E49: XFlush (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA17C1: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949==
==4949== Invalid write of size 8
==4949== at 0x717085: FGLRenderer::RenderView(player_t) (gl_scene.cpp:902)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0x12822d10 is 16 bytes inside a block of size 120 free'd
==4949== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0x86BB0A8: XFree (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x869BA1A: XFreeEventData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA06AF: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5AA1907: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949== by 0x78F407: TryRunTics() (d_net.cpp:1834)
==4949== by 0x785332: D_DoomLoop() (d_main.cpp:1010)
==4949== Block was alloc'd at
==4949== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==4949== by 0xAF428F9: ??? (in /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0)
==4949== by 0x86BAEB4: _XEnq (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B7B7E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x86B8554: _XEventsQueued (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x8699E49: XFlush (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==4949== by 0x5AA17C1: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A322E6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5A32334: ??? (in /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0)
==4949== by 0x5B1E8A: I_GetEvent() (i_input.cpp:467)
==4949== by 0x5B1EDE: I_StartTic() (i_input.cpp:481)
==4949== by 0x78D37D: NetUpdate() (d_net.cpp:978)
==4949==
==4949== Invalid read of size 8
==4949== at 0x71708C: FGLRenderer::RenderView(player_t) (gl_scene.cpp:905)
==4949== by 0x71823F: FGLInterface::RenderView(player_t) (gl_scene.cpp:1292)
==4949== by 0x7847D8: D_Display() (d_main.cpp:771)
==4949== by 0x78533C: D_DoomLoop() (d_main.cpp:1014)
==4949== by 0x789383: D_DoomMain() (d_main.cpp:2643)
==4949== by 0x5B4EF6: main (i_main.cpp:317)
==4949== Address 0xc0 is not stack'd, malloc'd or (recently) free'd
Stepping through the code, it appears that the global variable GLRenderer is never initialized on SDL.