From: Ian Jackson Date: Mon, 9 Feb 2015 15:10:11 +0000 (+0000) Subject: libxl: event handling: Add an assert to egc_run_callbacks X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3781 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6b5a5bba1a8025040947f39f1c80012373f35efe;p=xen.git libxl: event handling: Add an assert to egc_run_callbacks Check that the ao is still live when we are about to running some of its callbacks. This reveals an existing bug in libxl which is exercised by libvirt, converting libvirtd: libxl_event.c:1792: libxl__ao_complete_check_progress_reports: Assertion `ao->in_initiator' failed. into libvirtd: libxl_event.c:1338: egc_run_callbacks: Assertion `aop->ao->magic == 0xA0FACE00ul' failed. Signed-off-by: Ian Jackson CC: Ian Campbell CC: Wei Liu CC: Jim Fehlig Acked-by: Wei Liu --- diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 0d874d9c58..ae73728e21 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -1335,6 +1335,7 @@ static void egc_run_callbacks(libxl__egc *egc) aop->how->callback(CTX, aop->ev, aop->how->for_callback); CTX_LOCK; + assert(aop->ao->magic == LIBXL__AO_MAGIC); aop->ao->progress_reports_outstanding--; libxl__ao_complete_check_progress_reports(egc, aop->ao); CTX_UNLOCK;