Skip to content

Fix invalid QML comment and OpenGL shader info-log crash - #336

Closed
rjq wants to merge 4 commits into
AcademySoftwareFoundation:developfrom
rjq:fix/qml-comment-and-shader-log
Closed

Fix invalid QML comment and OpenGL shader info-log crash#336
rjq wants to merge 4 commits into
AcademySoftwareFoundation:developfrom
rjq:fix/qml-comment-and-shader-log

Conversation

@rjq

@rjq rjq commented Sep 4, 2026

Copy link
Copy Markdown

Summary

  • FileSystemBrowser.qml used a Python-style # comment, which QML does not support (invalid syntax).
  • shader_program_base.cpp dereferenced an empty std::vector's data()/[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 on maxLength > 0 before touching the log buffer.

Test plan

  • Rebuilt on macOS (Apple Silicon, Qt 6.5.3, Ninja) and confirmed the app now launches and stays running instead of segfaulting during viewport initialization.
  • Confirmed the previously-empty-info-log shader link failure is now caught and logged (critical log message) instead of crashing the process.

tedwaine and others added 3 commits June 23, 2026 12:03
…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>
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 4, 2026

Copy link
Copy Markdown

CLA Not Signed

@rjq
rjq force-pushed the fix/qml-comment-and-shader-log branch from c9870e1 to faff667 Compare September 4, 2026 16:42
@rjq
rjq changed the base branch from main to develop September 4, 2026 16:42
@rjq
rjq force-pushed the fix/qml-comment-and-shader-log branch from a0a37a7 to faff667 Compare September 4, 2026 16:44
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>
@rjq rjq closed this Sep 4, 2026
@rjq
rjq deleted the fix/qml-comment-and-shader-log branch September 4, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants