To be clear on scope: the user does have to fix their machine (reinstall the 32-bit drivers in my case), and I am not asking Steam to recover from that. But it took me several hours of debugging to identify the cause. A clear error message when glGetString returns NULL would have saved all of that.
+1 this should just abort and tell you to install 32 bit drivers instead of segfaulting
Started happening right after a kernel update to 7.0.0-30-generic (Linux Mint) while still on nvidia-driver-595-open (595.84) — can't confirm 100% whether the kernel bump alone triggered it or just coincided with hitting a pre-existing driver bug, but the timing was suspicious. Steam client segfaulted randomly during gameplay, roughly every 1-2 minutes, in a background thread (steamclient.so → vgui2_s.so → steamui.so, same offsets every crash, confirmed via coredump/gdb).
Upgrading to nvidia-driver-610-open (610.43.02) resolved it — 1h+ stable afterward vs. consistent crashes within 1-2 minutes before, kernel unchanged throughout. So the driver upgrade is the confirmed fix regardless of what originally triggered it.
Upgrading to nvidia-driver-610-open (610.43.02) - didnt resolve it, still crashes. But does not crash if you launch from steam in the terminal.
Nothing extracted yet.
Your system information
Please describe your issue in as much detail as possible:
The Steam client crashes because
vgui2_s.sopasses the return value ofglGetString(GL_EXTENSIONS)directly tostrstr()without checking forNULL.NULLis a documented possible return value per the OpenGL spec. WhenNULLis returned,strstr(NULL, _)invokes undefined behavior, and crashes.I observed this when the i386 NVIDIA GL backend was non-functional while the x86-64 one continued to work. The underlying cause may vary; the fix is the missing NULL check regardless of trigger.
Steps for reproducing this issue:
glGetString(GL_EXTENSIONS)returnsNULL. A reliable trigger: ensure the i386 NVIDIA libGL backend is non-functional (e.g., uninstall or breaklibnvidia-gl-<VER>:i386) while the x86-64 NVIDIA libs remain working.This can occur as part of Ubuntu's update process depending on how the user has installed their drivers eg using the .run, rather than Ubuntu's built in installer.
Investigation via GDB
Note at this point
haystackisNULL. We need to determine whyNote the call before the crashing call
call 0xeed90390Now lets decode the GOT slot
Looking at the disassembly since I do not have access to the code, the direct results of
glGetStringare being used without aNULLcheck. A possible retort is thatglGetStringshouldn't return null. However, refer to the OpenGL 4.6 spec (https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetString.xhtml).Proposed Fix
Properly handle
NULLwhen callingglGetString, ideally inform the user that the 32-bit drivers are not functional.Related
When researching this bug, these issues matched my crash:
_XError/strchr stack)