[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] fix assert fail in libxl__sigchld_installhandler



when libxl_sigchld_owner_libxl_always is used in libvirt or other
tools stack, there is a assertion fail in restore in
libxl__sigchld_installhandler during the following sequence:
create -> save -> restore.

here is the backtrace:
    #0  0x00007f7a522453d5 in raise () from /lib64/libc.so.6
    #1  0x00007f7a52246858 in abort () from /lib64/libc.so.6
    #2  0x00007f7a5223e2e2 in __assert_fail_base () from /lib64/libc.so.6
    #3  0x00007f7a5223e392 in __assert_fail () from /lib64/libc.so.6
    #4  0x00007f7a48008113 in libxl__sigchld_installhandler (
        gc=gc@entry=0x7f7a4f080480) at libxl_fork.c:225
    #5  0x00007f7a480081f4 in perhaps_installhandler 
(gc=gc@entry=0x7f7a4f080480,
        creating=creating@entry=false) at libxl_fork.c:272
    #6  0x00007f7a4800851f in libxl_childproc_setmode (ctx=0x7f7a400c0ee0,
        hooks=hooks@entry=0x7f7a482694a0 <childproc_hooks>,
        user=user@entry=0x7f7a48474f80 <child_info>) at libxl_fork.c:427

the sigchld_owner exists but it is not the same as the new CTX.
meanwhile the old sigchild is not removed in perhaps_removehandler.

Signed-off-by: Bamvor Jian Zhang <bjzhang@xxxxxxxx>
---
 tools/libxl/libxl_fork.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libxl/libxl_fork.c b/tools/libxl/libxl_fork.c
index 4ae9f94..9f1a5ce 100644
--- a/tools/libxl/libxl_fork.c
+++ b/tools/libxl/libxl_fork.c
@@ -252,7 +252,7 @@ static bool chldmode_ours(libxl_ctx *ctx, bool creating)
     case libxl_sigchld_owner_mainloop:
         return 0;
     case libxl_sigchld_owner_libxl_always:
-        return 1;
+        return creating || !LIBXL_LIST_EMPTY(&ctx->children);
     }
     abort();
 }
--
1.8.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.