gl4es
gl4es copied to clipboard
fpe_shader.c Segfault on RPI4/arm64
I've been using gl4es for awhile now on my 32 bit odroid XU4 for stepmania, and it has always worked great. I just got an RPI4 and installed the AARCH64 version of Arch Linux ARM on it and I'm getting the following crash on fpe_shader.c:482:
$ LD_PRELOAD=./libGL.so.1 LIBGL_ES=2 LIBGL_GL=2 gdb ./stepmania-release-symbols
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Feb 4 2021 19:40:09
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 2.0 backend
libEGL warning: DRI2: failed to authenticate
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: Extension GL_EXT_draw_buffers detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_OES_texture_stencil8 detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_OES_texture_float detected and used
LIBGL: Extension GL_OES_texture_half_float detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Extension GL_EXT_frag_depth detected and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 16384
LIBGL: Max Varying Vector: 32
LIBGL: Texture Units: 16/16 (hardware: 32), Max lights: 8, Max planes: 6
LIBGL: Max Color Attachments: 8 / Draw buffers: 8
LIBGL: Hardware vendor is Mesa/X.org
LIBGL: GLSL 300 es supported
LIBGL: GLSL 310 es supported and used
LIBGL: sRGB surface supported
LIBGL: EGLImage to Texture2D supported
LIBGL: EGLImage to RenderBuffer supported
LIBGL: Targeting OpenGL 2.1
LIBGL: NPOT texture handled in hardware
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/alarm/stepmania
LIBGL: Initialising gl4es
LIBGL: v1.1.5 built on Feb 4 2021 19:40:09
LIBGL: Using GLES 2.0 backend
LIBGL: loaded: libGLESv2.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 2.0 backend
libEGL warning: DRI2: failed to authenticate
LIBGL: Hardware Full NPOT detected and used
LIBGL: Extension GL_EXT_blend_minmax detected and used
LIBGL: Extension GL_EXT_draw_buffers detected and used
LIBGL: FBO are in core, and so used
LIBGL: PointSprite are in core, and so used
LIBGL: CubeMap are in core, and so used
LIBGL: BlendColor is in core, and so used
LIBGL: Blend Substract is in core, and so used
LIBGL: Blend Function and Equation Separation is in core, and so used
LIBGL: Texture Mirrored Repeat is in core, and so used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_element_index_uint detected and used
LIBGL: Extension GL_OES_packed_depth_stencil detected and used
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_depth_texture detected and used
LIBGL: Extension GL_OES_texture_stencil8 detected and used
LIBGL: Extension GL_EXT_texture_rg detected and used
LIBGL: Extension GL_OES_texture_float detected and used
LIBGL: Extension GL_OES_texture_half_float detected and used
LIBGL: Extension GL_EXT_color_buffer_float detected and used
LIBGL: Extension GL_EXT_color_buffer_half_float detected and used
LIBGL: high precision float in fragment shader available and used
LIBGL: Extension GL_EXT_frag_depth detected and used
LIBGL: Max vertex attrib: 16
LIBGL: Extension GL_OES_standard_derivatives detected and used
LIBGL: Max texture size: 16384
LIBGL: Max Varying Vector: 32
LIBGL: Texture Units: 16/16 (hardware: 32), Max lights: 8, Max planes: 6
LIBGL: Max Color Attachments: 8 / Draw buffers: 8
LIBGL: Hardware vendor is Mesa/X.org
LIBGL: GLSL 300 es supported
LIBGL: GLSL 310 es supported and used
LIBGL: sRGB surface supported
LIBGL: EGLImage to Texture2D supported
LIBGL: EGLImage to RenderBuffer supported
LIBGL: Targeting OpenGL 2.1
LIBGL: NPOT texture handled in hardware
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: try to use VBO
LIBGL: Force texture for Attachment color0 on FBO
LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/home/alarm/stepmania
StepMania5.2-git-adb3a52ba0
Compiled 20210204 @ 19:54:49 (build adb3a52ba0)
Log starting 2021-02-05 02:20:26
OS: Linux ver 051012
Runtime library: glibc 2.32
Threads library: NPTL 2.32
libavcodec: 0x372765 (3614565)
ALSA: Advanced Linux Sound Architecture Driver Version k5.10.12-2-ARCH.
ALSA Driver: 0: bcm2835 ALSA [ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA], 7/7 subdevices avail
ALSA Driver: 0: bcm2835 ALSA [ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI], 1/1 subdevices avail
ALSA Driver: 1: vc4-hdmi-0 [vc4hdmi0], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0], 1/1 subdevices avail
ALSA Driver: 2: vc4-hdmi-1 [vc4hdmi1], device 0: MAI PCM vc4-hdmi-hifi-0 [MAI PCM vc4-hdmi-hifi-0], 1/1 subdevices avail
ALSA: dsnd_pcm_hw_params_set_access: Invalid argument
Couldn't load driver ALSA-sw: SetHWParams failed
Couldn't load driver OSS: RageSoundDriver_OSS: Couldn't open /dev/dsp: No such file or directory
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Couldn't load driver JACK: Couldn't connect to JACK server
Sound driver: Pulse
Lights driver: SystemMessage
Lights driver: Export
Video renderers: 'opengl'
Display: :0.0 (screen 0)
X server vendor: The X.Org Foundation [1.20.10.0]
Server GLX vendor: ptitSeb [1.4 GL4ES]
Client GLX vendor: ptitSeb [1.4 GL4ES]
Paletted textures disabled: GL_EXT_paletted_texture missing.
Thread 1 "stepmania-relea" received signal SIGSEGV, Segmentation fault.
0x0000fffff7402a5c in strcpy () from /usr/lib/libc.so.6
(gdb) bt
#0 0x0000fffff7402a5c in strcpy () from /usr/lib/libc.so.6
#1 0x0000fffff7edaa0c in fpe_FragmentShader (need=need@entry=0xffffffffdee8,
state=<optimized out>, state@entry=0x0)
at /home/alarm/gl4es/src/gl/fpe_shader.c:842
#2 0x0000fffff7f201fc in gl4es_glLinkProgram (program=<optimized out>)
at /home/alarm/gl4es/src/gl/program.c:765
#3 0x0000aaaaab30b5f0 in LoadShader (ShaderType=ShaderType@entry=35633,
sFile="Data/Shaders/GLSL/Texture matrix scaling.vert",
asDefines=std::vector of length 0, capacity 0)
at /home/alarm/stepmania/src/RageDisplay_OGL.cpp:381
#4 0x0000aaaaab30bc98 in InitShaders ()
at /home/alarm/stepmania/src/RageDisplay_OGL.cpp:416
#5 0x0000aaaaab30e8a0 in RageDisplay_Legacy::TryVideoMode[abi:cxx11](VideoModeParams const&, bool&) (this=0xaaaaacc78140, p=...,
bNewDeviceOut=<optimized out>)
at /home/alarm/stepmania/src/RageDisplay_OGL.cpp:785
#6 0x0000aaaaab2fad38 in RageDisplay::SetVideoMode[abi:cxx11](VideoModeParams, bool&) (this=this@entry=0xaaaaacc78140, p=...,
bNeedReloadTextures=@0xffffffffebbf: true)
at /home/alarm/stepmania/src/RageDisplay.cpp:83
#7 0x0000aaaaab308d9c in RageDisplay_Legacy::Init[abi:cxx11](VideoModeParams const&, bool) (this=this@entry=0xaaaaacc78140, p=...,
bAllowUnacceleratedRenderer=false)
gl4es was built with the odroid profile per the COMPILE instructions.
Oddly enough, if I run it on v1.1.0 of gl4es, the game launches without the segfault but freezes later on when navigating the menus. The game runs normally without gl4es (although the performance is quite bad), and it runs great on my XU4, so I'm wondering if ARM64 and/or the RPI4 are causing problems with gl4es. Any ideas on how to troubleshoot?