From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: [PATCH] libxl: initialize vfb defbools in libxlMakeVfb Date: Wed, 6 May 2015 10:15:36 +0100 Message-ID: <1430903736.2660.172.camel__48062.5984761447$1430903859$gmane$org@citrix.com> References: <1429291171-23640-1-git-send-email-olaf@aepfle.de> <20150417175928.GA2516@aepfle.de> <553165B7.8000204@suse.com> <1430487940.15640.32.camel@citrix.com> <20150506082454.GB10182@aepfle.de> <1430903289.2660.169.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1430903289.2660.169.camel@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Olaf Hering Cc: libvir-list@redhat.com, Jim Fehlig , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, 2015-05-06 at 10:08 +0100, Ian Campbell wrote: > On Wed, 2015-05-06 at 10:24 +0200, Olaf Hering wrote: > > On Fri, May 01, Ian Campbell wrote: > > > > > Olaf, please can you use gdb to capture the stack trace so we can fix > > > this (and the other issue) properly in libxl instead of just hacking > > > around it in libvirt (which might also be appropriate for compat with > > > old libxl but shouldn't be done without also fixing libxl IMHO). > > > > The code flow was essentially like this: > > > > libxl_device_vfb_init(libxl); > > switch(libvirt->type) { > > case SDL: > > libxl_defbool_set(libxl->sdl.enable, 1); > > break; > > case VNC: > > libxl_defbool_set(libxl->vnc.enable, 1); > > break; > > } > > > > if (libvirt->os.type == HVM) { > > if (libxl_defbool_val(libxl->vnc.enable)) { > > /* do VNC things */ > > } else if (libxl_defbool_val(libxl->sdl.enable)) { > > /* do SDL things */ > > if (libxl_defbool_val(libxl->opengl.enable)) > > /* do openGL things */ > > } > > } > > > > > > The first crash was because I had SDL enabled, and the SDL case did not > > initialize the defbool for VNC. Once it did the next crash was the > > openGL part which was not initialized either. > > > > I see nothing wrong with libxl in such usage. > Please provide the actual stack trace as requested so we can see which > code path in libxl is failing to properly initialise the defbools. Ah, one moment, are you saying that all this code is within libvirt and not in libxl and that the "libxl->" object here hasn't yet been passed to a libxl function? If so then yes it is a libvirt bug to use libxl_defbool_val(libxl->opengl.enable) without having called set on it first. If you passed such a thing to libxl and it crashed then that would be a libxl bug, but it seems you aren't getting that far. I was confused by the initial message because the assert says libxl.c, but that's just because it is out of line, which lead to a confusing error message. Sorry for leading the conversation down the wrong alley way. Ian.