All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>, xen-devel <xen-devel@lists.xen.org>
Subject: Re: segv in osevent_release_nexus with libxl backend to libvirt
Date: Thu, 27 Nov 2014 10:22:25 +0000	[thread overview]
Message-ID: <1417083745.12784.1.camel@citrix.com> (raw)
In-Reply-To: <21622.4088.777274.315050@mariner.uk.xensource.com>

On Wed, 2014-11-26 at 17:38 +0000, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] segv in osevent_release_nexus with libxl backend to libvirt"):
> > I don't know if this helps but on the 3 occasions I've just looked at
> > the ev passed to libxl__ev_fd_deregister contains an fd which
> > corresponds to a still open handle on /dev/xen/evtchn.
> 
> I see what is going on, I think.  The rules in libxl_event.h about
> when one can call libxl_event_register_callbacks are (a) impossibly
> lax and (b) not implemented even as far as possible.  The crash is due
> to the evtchn fd having been set up during libxl initialisation (while
> hooks==0) and therefore not having a `nexus', but being deregistered
> later.
> 
> AFAICT libvirt doesn't (I think) depend on anything which is
> particularly difficult to implement.  It seems to call
> libxl_event_register_callbacks in a relatively quiescent state.
> 
> I have prepared a set of patches which may help.  They are at
> xenbits.xen.org:ext/xen.git#for-ijc.

AKA git://xenbits.xen.org/people/iwj/xen.git for those of us without
your shell account ;-)

I tried this but on destroy with libvirt I get:
        libvirtd: libxl.c:168: libxl_ctx_free: Assertion `!libxl__ev_fd_isregistered(&ctx->sigchld_selfpipe_efd)' failed.
        
        Program received signal SIGABRT, Aborted.
        [Switching to Thread 0xb57f9420 (LWP 7188)]
        0xb6ab7f96 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
        (gdb) bt
        #0  0xb6ab7f96 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
        #1  0xb6ac5f8a in raise () from /lib/arm-linux-gnueabihf/libc.so.6
        #2  0xb6ac8428 in abort () from /lib/arm-linux-gnueabihf/libc.so.6
        #3  0xb6ac101e in __assert_fail ()
           from /lib/arm-linux-gnueabihf/libc.so.6
        #4  0xb16a48f4 in libxl_ctx_free (ctx=0xb6b7bbec) at libxl.c:168
        #5  0xb171814e in libxlDomainObjPrivateDispose ()
           from /opt/libvirt/lib/libvirt/connection-driver/libvirt_driver_libxl.so
        #6  0xb6c69176 in virObjectUnref ()
           from /opt/libvirt/lib/libvirt.so.0
        #7  0xb17181d2 in libxlDomainObjPrivateFree ()
           from /opt/libvirt/lib/libvirt/connection-driver/libvirt_driver_libxl.so
        #8  0xb6c9c0da in virDomainObjDispose ()
           from /opt/libvirt/lib/libvirt.so.0
        #9  0xb6c69176 in virObjectUnref ()
           from /opt/libvirt/lib/libvirt.so.0
        #10 0xb6c9ca26 in virDomainObjListRemove ()
           from /opt/libvirt/lib/libvirt.so.0
        #11 0xb171c548 in libxlDomainDestroyFlags ()

and similarly on create with xl I see:

        xl: libxl.c:168: libxl_ctx_free: Assertion `!libxl__ev_fd_isregistered(&ctx->sigchld_selfpipe_efd)' failed.
        
        Program received signal SIGABRT, Aborted.
        0xb6e10f96 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
        (gdb) bt
        #0  0xb6e10f96 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
        #1  0xb6e1ef8a in raise () from /lib/arm-linux-gnueabihf/libc.so.6
        #2  0xb6e21428 in abort () from /lib/arm-linux-gnueabihf/libc.so.6
        #3  0xb6e1a01e in __assert_fail () from /lib/arm-linux-gnueabihf/libc.so.6
        #4  0xb6f628f4 in libxl_ctx_free (ctx=0xb6ed4bec) at libxl.c:168
        #5  0x0000daa0 in xl_ctx_free () at xl.c:283
        #6  0xb6e22426 in ?? () from /lib/arm-linux-gnueabihf/libc.so.6
        #7  0xb6e10cfe in __libc_start_main () from /lib/arm-linux-gnueabihf/libc.so.6
        #8  0x0000da26 in _start ()
        
Ian.

  reply	other threads:[~2014-11-27 10:22 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 15:37 segv in osevent_release_nexus with libxl backend to libvirt Ian Campbell
     [not found] ` <21621.61406.151530.376288@mariner.uk.xensource.com>
2014-11-26 15:40   ` Ian Campbell
2014-11-26 15:52     ` Ian Campbell
2014-11-26 17:38       ` Ian Jackson
2014-11-27 10:22         ` Ian Campbell [this message]
2014-11-27 18:27           ` [PATCH for-4.5 0/6] libxl: events: Tear down fd interests when idle Ian Jackson
2014-11-27 18:27             ` [PATCH 1/6] libxl: events: Assert that libxl_ctx_free is not called from a hook Ian Jackson
2014-11-28 12:42               ` Ian Campbell
2014-11-27 18:27             ` [PATCH 2/6] libxl: events: Deregister xenstore watch fd when not needed Ian Jackson
2014-11-28 13:06               ` Ian Campbell
2014-11-28 14:56                 ` Ian Jackson
2014-11-28 15:00                   ` Ian Campbell
2014-11-28 13:19               ` Ian Campbell
2014-11-27 18:27             ` [PATCH 3/6] libxl: events: Deregister, don't just modify, sigchld pipe fd Ian Jackson
2014-11-28 12:48               ` Ian Campbell
2014-11-28 14:42                 ` Ian Jackson
2014-11-28 14:44                   ` Ian Campbell
2014-11-27 18:27             ` [PATCH 4/6] libxl: events: Tear down SIGCHLD machinery on ctx destruction Ian Jackson
2014-11-28 12:51               ` Ian Campbell
2014-11-27 18:27             ` [PATCH 5/6] libxl: events: Deregister evtchn fd when not needed Ian Jackson
2014-11-28 13:04               ` Ian Campbell
2014-11-28 14:47                 ` Ian Jackson
2014-11-28 14:52                   ` Ian Campbell
2014-12-09 11:22                     ` Ian Jackson
2014-12-09 11:31                       ` Ian Campbell
2014-12-09 15:48                         ` [PATCH 5/6] libxl: events: Deregister evtchn fd when not needed [and 1 more messages] Ian Jackson
2014-11-27 18:27             ` [PATCH 6/6] libxl: events: Document and enforce actual callbacks restriction Ian Jackson
2014-11-28 13:04               ` Ian Campbell
2014-11-27 18:30             ` [PATCH for-4.5 0/6] libxl: events: Tear down fd interests when idle Ian Jackson
2014-11-28 13:05               ` Ian Campbell
2014-12-08 16:18                 ` Konrad Rzeszutek Wilk
2014-12-08 10:33               ` Ian Campbell
2014-12-09 15:54             ` [PATCH for-4.5 v2 " Ian Jackson
2014-12-09 15:54               ` [PATCH 1/6] libxl: events: Assert that libxl_ctx_free is not called from a hook Ian Jackson
2014-12-09 15:54               ` [PATCH 2/6] libxl: events: Deregister xenstore watch fd when not needed Ian Jackson
2014-12-09 15:59                 ` Ian Campbell
2014-12-09 16:13                   ` Ian Jackson
2014-12-09 15:54               ` [PATCH 3/6] libxl: events: Deregister, don't just modify, sigchld pipe fd Ian Jackson
2014-12-09 15:54               ` [PATCH 4/6] libxl: events: Tear down SIGCHLD machinery on ctx destruction Ian Jackson
2014-12-09 15:54               ` [PATCH 5/6] libxl: events: Deregister evtchn fd when not needed Ian Jackson
2014-12-09 15:56                 ` Ian Campbell
2014-12-09 15:54               ` [PATCH 6/6] libxl: events: Document and enforce actual callbacks restriction Ian Jackson
2014-12-10 10:45               ` [PATCH for-4.5 v2 0/6] libxl: events: Tear down fd interests when idle Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417083745.12784.1.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=jfehlig@suse.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.