Open qarmin opened 2 years ago
==98018== Conditional jump or move depends on uninitialised value(s)
==98018== at 0x555BC7B: g_utf8_offset_to_pointer (gutf8.c:371)
==98018== by 0x555BC7B: g_utf8_offset_to_pointer (gutf8.c:351)
==98018== by 0x4A2B177: gtk_editable_get_chars (gtkeditable.c:573)
==98018== by 0x11160C: <O as gtk4::auto::editable::EditableExt>::chars (editable.rs:181)
==98018== by 0x11146E: foo::main (main.rs:10)
==98018== by 0x11159A: core::ops::function::FnOnce::call_once (function.rs:227)
==98018== by 0x11163D: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:123)
==98018== by 0x111730: std::rt::lang_start::{{closure}} (rt.rs:145)
==98018== by 0x12950A: std::rt::lang_start_internal (function.rs:259)
==98018== by 0x1116FF: std::rt::lang_start (rt.rs:144)
==98018== by 0x1114DB: main (in /home/slomo/Projects/rust/gtk-rs/gtk4-rs/target/debug/foo)
==98018== Uninitialised value was created by a heap allocation
==98018== at 0x483F7B5: malloc (vg_replace_malloc.c:381)
==98018== by 0x552DDB8: g_malloc (gmem.c:106)
==98018== by 0x48AD9FB: g_signal_newv (gsignal.c:1781)
==98018== by 0x48ADF72: g_signal_new_valist (gsignal.c:1983)
==98018== by 0x48AE0D0: g_signal_new (gsignal.c:1512)
==98018== by 0x4A3C35F: gtk_event_controller_key_class_init (gtkeventcontrollerkey.c:244)
==98018== by 0x4A3C35F: gtk_event_controller_key_class_intern_init (gtkeventcontrollerkey.c:69)
==98018== by 0x48B6CB7: type_class_init_Wm (gtype.c:2297)
==98018== by 0x48B6CB7: g_type_class_ref (gtype.c:3012)
==98018== by 0x48A0217: g_object_new_with_properties (gobject.c:2078)
==98018== by 0x48A0BB0: g_object_new (gobject.c:1779)
==98018== by 0x4B51598: gtk_text_init (gtktext.c:1941)
==98018== by 0x48B8B19: g_type_create_instance (gtype.c:1929)
==98018== by 0x489ECBC: g_object_new_internal (gobject.c:1939)
[...]
==98018== Invalid read of size 1
==98018== at 0x4845AEB: strncpy (vg_replace_strmem.c:599)
==98018== by 0x5547E97: UnknownInlinedFun (string_fortified.h:95)
==98018== by 0x5547E97: g_strndup (gstrfuncs.c:462)
==98018== by 0x11160C: <O as gtk4::auto::editable::EditableExt>::chars (editable.rs:181)
==98018== by 0x11146E: foo::main (main.rs:10)
==98018== by 0x11159A: core::ops::function::FnOnce::call_once (function.rs:227)
==98018== by 0x11163D: std::sys_common::backtrace::__rust_begin_short_backtrace (backtrace.rs:123)
==98018== by 0x111730: std::rt::lang_start::{{closure}} (rt.rs:145)
==98018== by 0x12950A: std::rt::lang_start_internal (function.rs:259)
==98018== by 0x1116FF: std::rt::lang_start (rt.rs:144)
==98018== by 0x1114DB: main (in /home/slomo/Projects/rust/gtk-rs/gtk4-rs/target/debug/foo)
Bug in GTK it seems. Seems to end up working with invalid pointers somewhere.
Bug description
cause crash:
Issue found by fuzzer - https://github.com/qarmin/gtk-rs-fuzzer