Skip to content

Fix segmentation fault when running GTK4

Nelson Ben requested to merge fix_sigsegv_when_renderer_not_found into main

Trying to run any GTK4 app with current GTK main branch results in a segmentation fault in my system. Caused by code assuming a GError must be present, but it is not because the functions supposed to return a GError hit first a g_return_val_if_fail() which makes them return FALSE without filling the GError out parameter.

When the fix in here I can run GTK4 apps again, with some g_critical() messages printed to the console because of the g_return_val_if_fail() hit, but that seems to not affect the execution, they are related to some renderers not being found.

The messages printed on console are:

GLib[476437]:CRITICAL: g_strstr_len: assertion 'haystack != NULL' failed
GLib[476437]:CRITICAL: g_strstr_len: assertion 'haystack != NULL' failed
 Gsk[476437]: WARNING: Failed to locate VERTEX_SHADER in shader source
 Gsk[476437]:CRITICAL: gsk_gl_compiler_compile: assertion 'self->fragment_source != NULL'

Merge request reports