Fix invalid QML comment and OpenGL shader info-log crash - #336
Closed
rjq wants to merge 4 commits into
Closed
Conversation
…Foundation/develop Trivial merge from develop to main to validate workflow actions
FileSystemBrowser.qml used a Python-style `#` comment, which QML does not support. shader_program_base.cpp dereferenced an empty info-log vector when a driver reports a compile failure but leaves the log length at 0. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B2oxqFLjvrhWTVsUWonajB Signed-off-by: Ryan J. Quinlan <rjq@rjqfx.com>
Same undefined-behavior pattern as the vertex/fragment shader compile paths: some drivers report a program link failure but leave the info log empty, and dereferencing an empty vector's data() segfaulted during viewport renderer setup (SDF text shader link) on Apple's Metal-backed OpenGL. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B2oxqFLjvrhWTVsUWonajB Signed-off-by: Ryan J. Quinlan <rjq@rjqfx.com>
|
rjq
force-pushed
the
fix/qml-comment-and-shader-log
branch
from
September 4, 2026 16:42
c9870e1 to
faff667
Compare
rjq
force-pushed
the
fix/qml-comment-and-shader-log
branch
from
September 4, 2026 16:44
a0a37a7 to
faff667
Compare
If even the "no image" fallback shader fails to compile/link (e.g. a driver that reports failure with an empty info log), active_shader_program_ is left null. bind_textures() already treats this as nothing-to-draw, but draw_image() dereferenced it unconditionally, segfaulting as soon as media was loaded and a frame draw was attempted. This reliably crashed on an Apple M4 Max where the default GLSL shaders fail to link on the OpenGL-4.1-over-Metal driver. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01B2oxqFLjvrhWTVsUWonajB Signed-off-by: Ryan J. Quinlan <rjq@rjqfx.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FileSystemBrowser.qmlused a Python-style#comment, which QML does not support (invalid syntax).shader_program_base.cppdereferenced an emptystd::vector'sdata()/[0]when a driver reports a shader compile or program link failure but leaves the info log empty (maxLength == 0). On Apple Silicon with the Metal-backed OpenGL driver this reliably segfaulted during viewport renderer setup (building the SDF text shader), taking down the whole application. All three call sites (vertex shader compile, fragment shader compile, program link) now guard onmaxLength > 0before touching the log buffer.Test plan
criticallog message) instead of crashing the process.