g_is_object segmentfault
I Have a App build with fedora 28 and mingw32 and glib2-2.56, It's running OK. And then build with fedora 31+ and mingw32 and glib2-60+, It will crash. The crash message display as bellow:
g_type_check_instance_cast (type_instance=0x7d92bad0, iface_type=169816792) at gtype.c:4060 - Program terminated with signal SIGSEGV, Segmentation fault
By checking the Fedora 31+ mingw32 rpm spec and meson file, I found glib2 build with G_DEBUG_ENABLE, so after all GTypeInstance freeing, "instance" will be set by 0xaa, as bellow
#ifdef G_ENABLE_DEBUG
memset (allocated, 0xaa, ivar_size + private_size);
#endif
It will cause app crash when call G_IS_OBJECT and some other G_check_xxxx func after call g_object_unref. fix it by drop default buildtype=debugoptimized and set buildtype=release
meson -Dbuildtype=release