On 10/03/2018 01:48 PM, Fabiano FidĂȘncio wrote:
Commit 7190c5024d introduced the usage of new GObject define macros
with
private. However as the conversion hasn't been done for abstract types
(G_DEFINE_ABSTRACT_TYPE) and the addition of the private classes for the
abstract types has been removed as part of the commit, crashes can be
seen in Apps consuming libvirt-glib, as this one from GNOME Boxes:
Thread 1 "gnome-boxes" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ef2b35 in g_type_check_instance_is_fundamentally_a () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
(gdb) bt
#0 0x00007ffff7ef2b35 in g_type_check_instance_is_fundamentally_a () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#1 0x00007ffff7ed2e75 in g_object_unref () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#2 0x00007ffff6ef094e in gvir_domain_device_set_property (object=0x555556680950,
prop_id=2, value=0x7fffffffcbe0,
pspec=0x555556772540) at libvirt-gobject-domain-device.c:89
#3 0x00007ffff7ed3b19 in ?? () from /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#4 0x00007ffff7ed5624 in g_object_new_valist () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#5 0x00007ffff7ed5959 in g_object_new () from
/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0
#6 0x00005555555d8257 in boxes_libvirt_machine_get_domain_disk (self=0x5555560e6790,
error=0x55555615a630)
at /run/build/gnome-boxes/src/libvirt-machine.vala:547
#7 0x00005555555d0e7e in boxes_libvirt_machine_update_io_stat_co
(_data_=0x55555615a320)
at /run/build/gnome-boxes/src/libvirt-machine.vala:280
#8 0x00005555555d09b2 in boxes_libvirt_machine_update_io_stat (self=0x5555560e6790,
info=0x555555f25990, stat=0x555556736a90,
_callback_=0x5555555d2992 <boxes_libvirt_machine_update_stats_ready>,
_user_data_=0x555556736a50)
at /run/build/gnome-boxes/src/libvirt-machine.vala:5
#9 0x00005555555d3120 in boxes_libvirt_machine_update_stats_co (_data_=0x555556736a50)
at /run/build/gnome-boxes/src/libvirt-machine.vala:332
#10 0x00005555555d29dd in boxes_libvirt_machine_update_stats_ready
(source_object=0x5555567bb840, _res_=0x55555677ae00,
_user_data_=0x555556736a50) at /run/build/gnome-boxes/src/libvirt-machine.vala:328
#11 0x00007ffff72adc89 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#12 0x00007ffff72adcc9 in ?? () from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#13 0x00007ffff7dec948 in g_main_context_dispatch () from
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#14 0x00007ffff7decd38 in ?? () from /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#15 0x00007ffff7decdcc in g_main_context_iteration () from
/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0
#16 0x00007ffff72c2dbd in g_application_run () from
/usr/lib/x86_64-linux-gnu/libgio-2.0.so.0
#17 0x00005555556004b6 in _vala_main (args=0x7fffffffd4f8, args_length1=1) at
/run/build/gnome-boxes/src/main.vala:84
#18 0x0000555555600517 in main (argc=1, argv=0x7fffffffd4f8) at
/run/build/gnome-boxes/src/main.vala:68
In order to solve the issue, let's just replace G_DEFINE_ABSTRACT_TYPE
by G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE.
Signed-off-by: Fabiano FidĂȘncio <fidencio(a)redhat.com>
---
libvirt-gconfig/libvirt-gconfig-domain-address.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-chardev-source.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-chardev.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-controller.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-graphics.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-hostdev.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-interface.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-smartcard.c | 2 +-
libvirt-gconfig/libvirt-gconfig-domain-timer.c | 2 +-
libvirt-gobject/libvirt-gobject-domain-device.c | 2 +-
10 files changed, 10 insertions(+), 10 deletions(-)
Oops. ACKed and pushed. Congratulations on your first libvirt-glib
contribution.
Michal