On 04/09/2018 03:39 AM, Peter Xu wrote: > Free the AIO context earlier than the GMainContext (if we have) to > workaround a glib2 bug that GSource context pointer is not cleared even > if the context has already been destroyed (while it should). > > The patch itself only changed the order to destroy the objects, no > functional change at all. Without this workaround, we can encounter > qmp-test hang with oob (and possibly any other use case when iothread is > used with GMainContexts): >
> The glib2 bug is fixed in commit 26056558b ("gmain: allow > g_source_get_context() on destroyed sources", 2012-07-30), the first > good version is glib2 2.33.10. So this error will be encountered before > any glib version older than 2.33.10 (not including). Since we are still > supporting even older glib versions, we may want this workaround. Grammar is awkward; I'd suggest: ...the first good version is glib2 2.33.10. But we still support building with glib as old as 2.28, so we need the workaround. > > Let's make sure we destroy the GSources first before its owner context > until we drop support for glibs older than 2.33.10. > > Signed-off-by: Peter Xu <pet...@redhat.com> > --- > v2: > - verified the root cause of the bug, and enhance commit message and > comments correspondingly Reviewed-by: Eric Blake <ebl...@redhat.com> If Stefan is happy with your improved commit message, I'll queue this for -rc3. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature