SuperTux / supertux

SuperTux source code
https://supertux.org
GNU General Public License v3.0
2.5k stars 476 forks source link

Segmentation fault on start #1137

Closed Gallaecio closed 5 years ago

Gallaecio commented 5 years ago

SuperTux version: 0.6.0 System information: Linux 4.19.26-1-CHAKRA #1 SMP PREEMPT x86_64 GNU/Linux

The game crashes upon start with a segfault:

$ supertux2 
Segmentation fault (core dumped)

GDB output:

(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00005555558cc48f in GLVertexArrays::GLVertexArrays(GL33CoreContext&) ()
#2  0x00005555558c7083 in GL33CoreContext::GL33CoreContext(GLVideoSystem&) ()
#3  0x00005555557d85ff in GLVideoSystem::GLVideoSystem(bool) ()
#4  0x00005555556d544a in VideoSystem::create(VideoSystem::Enum) ()
#5  0x00005555556889bd in Main::launch_game(CommandLineArguments const&) ()
#6  0x000055555568b200 in Main::run(int, char**) ()
#7  0x00005555556847e7 in main ()

It may be related to #779.

I can reproduce the issue with master (ce839a6b084d0d50c89b08705434ff65dc858f79) with a package built using the supertux-git source package from the Arch User Repository.

Grumbel commented 5 years ago

What is your graphics card?

Run supertux --verbose and post the output.

Also try:

supertux2 --renderer opengl

supertux2 --renderer opengl20

supertux2 --renderer sdl

Gallaecio commented 5 years ago

Both supertux2 --renderer opengl20 and supertux2 --renderer sdl work. supertux2 --renderer opengl crashes.

$ supertux2 --verbose
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/supertux/main.cpp:302 PhysfsWriteDir: <$HOME>/.local/share/supertux2/
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/supertux/main.cpp:303 PhysfsSearchPath:
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/supertux/main.cpp:307   <$HOME>/.local/share/supertux2/
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/supertux/main.cpp:307   <$HOME/Downloads>/supertux-git/src/supertux/data
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/util/timelog.cpp:36 Component 'config' finished after 0 seconds
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/util/timelog.cpp:36 Component 'tinygettext' finished after 0.373 seconds
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/util/timelog.cpp:36 Component 'controller' finished after 0 seconds
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/util/timelog.cpp:36 Component 'commandline' finished after 0 seconds
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/video/gl/gl_video_system.cpp:138 Requesting OpenGL 3.3 Core context
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/video/gl/gl_video_system.cpp:238 OpenGL: 3.3.0 NVIDIA 418.43
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/video/gl/gl_video_system.cpp:239 Using GLEW 1.10.0
[INFO] <$HOME/Downloads>/supertux-git/src/supertux/src/video/gl/gl_video_system.cpp:240 GLEW_ARB_texture_non_power_of_two: 0
Segmentation fault (core dumped)
$ supertux2 --renderer opengl
Segmentation fault (core dumped)
$ supertux2 --renderer opengl20
$ supertux2 --renderer sdl
$ 
Grumbel commented 5 years ago

What graphics card are you using? Post the full output of glewinfo.

Might be that GLEW 1.10 is to old or has a bug, as Vertex Array Objects should have been supported since 1.5.1.

Another suspicious thing is "GLEW_ARB_texture_non_power_of_two: 0", that should be 1 for anything but completely ancient video cards, so probably something going wrong with GLEW initialization.

Gallaecio commented 5 years ago

glewinfo.txt

Grumbel commented 5 years ago

Little out of ideas here. Try recompiling with a newer version of glew. Your glewinfo output looks proper and contains all the necessary stuff, but within SuperTux they go missing, e.g.:

GL_ARB_texture_non_power_of_two:                               OK

and in SuperTux:

GLEW_ARB_texture_non_power_of_two: 0

Same with glGenVertexArrays I assume.

Gallaecio commented 5 years ago

I upgraded to glew 2.1.0 and rebuilt, and it worked. Thanks!