glib crash via eventtest.c

Cole Robinson crobinso at redhat.com
Mon Feb 10 18:13:55 UTC 2020


I attempted to review some patches on Friday and started hitting
occasional crashes via eventtest.c. Long story short it's a glib bug:

https://gitlab.gnome.org/GNOME/glib/merge_requests/1358

It's a ref counting issue caused when g_source_remove
(virEventRemoveHandle) is called from one thread, while the main loop is
in a particular state in a different thread.

The way vireventglib is implemented means every user initiated
g_source_remove is likely called from a different thread so we risk
hitting this. Not sure how likely it is in realworld usage,
vireventtest.c is pretty pathologic in this area. We could change
vireventglib.c to do the final source_unref from the idle callback which
would avoid the problem

Thanks,
Cole




More information about the libvir-list mailing list