Runtime warnings from an address sanitizer due to G_ADD_PRIVATE
Continuing from gtk#6466 (closed), there are reported problems when
gtk had been built with sanitizers
ADD_FLAGS="-fsanitize=bounds,alignment,object-size,undefined -fno-omit-frame-pointer -fstack-protector-all -fstack-protector-strong -fno-optimize-sibling-calls"
export CFLAGS="-g -O2 -Wall $ADD_FLAGS"
export CXXFLAGS="-g -O2 -Wall $ADD_FLAGS"
export LDFLAGS="$LDFLAGS $ADD_FLAGS -lasan -lubsan -lpthread -ldl -Wl,-z,undefs"
unset ADD_FLAGS
export ASAN_OPTIONS=abort_on_error=0:detect_stack_use_after_return=0:detect_leaks=0:handle_segv=0:check_printf=0:detect_deadlocks=1:replace_str=1:replace_intrin=1:alloc_dealloc_mismatch=1:new_delete_type_mismatch=1:detect_container_overflow=1:symbolize=1
meson setup ......
when I started gnome-software:
../subprojects/gtk/gdk/gdkdisplay.c:129:1: runtime error: applying non-zero offset 18446744073709551568 to null pointer
../subprojects/gtk/gtk/gtktogglebutton.c:141:1: runtime error: applying non-zero offset 18446744073709551216 to null pointer
../subprojects/gtk/gtk/gtksymbolicpaintable.c:113:7: runtime error: null pointer passed as argument 2, which is declared to never be null
.
.
.
../subprojects/gtk/gtk/gtkentrybuffer.c:165:7: runtime error: null pointer passed as argument 2, which is declared to never be null
and when I opened the gtk inspector there:
../subprojects/gtk/gtk/roaring/roaring.c:10516:5: runtime error: null pointer passed as argument 1, which is declared to never be null
../subprojects/gtk/gtk/roaring/roaring.c:10516:5: runtime error: null pointer passed as argument 2, which is declared to never be null
../subprojects/gtk/gtk/roaring/roaring.c:10529:9: runtime error: null pointer passed as argument 1, which is declared to never be null
../subprojects/gtk/gtk/roaring/roaring.c:10529:9: runtime error: null pointer passed as argument 2, which is declared to never be null
../subprojects/gtk/gtk/gtkwindow.c:514:1: runtime error: applying non-zero offset 18446744073709551040 to null pointer
../subprojects/gtk/gtk/gtkapplication.c:152:1: runtime error: applying non-zero offset 18446744073709551392 to null pointer
../subprojects/gtk/gtk/inspector/prop-editor.c:939:33: runtime error: signed integer overflow: 2147483647 - -1 cannot be represented in type 'int'
../subprojects/gtk/gtk/gtkcheckbutton.c:148:1: runtime error: applying non-zero offset 18446744073709551232 to null pointer
The gnome-software is a heavy hammer for this, it's just that I wanted to check https://bugzilla.redhat.com/show_bug.cgi?id=2265429 , which seems to be fixed by the commit gtk@c93fa922 , but I've no evidence of it except it does not crash in my environment with gtk built at that commit.