WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] xend segfaults when starting

On Wednesday 11 August 2010 15:11:54 Ian Campbell wrote:
> On Wed, 2010-08-04 at 15:55 +0100, Stefano Stabellini wrote:
> > > > On Wed, 2010-08-04 at 14:12 +0100, Christoph Egger wrote:
> > > > > Hi!
> > > > >
> > > > > xend causes python to segfault on startup.
> > > > > The changeset in error is: 21904:6a0dd2c29999
> >
> > It doesn't, in fact:
> >
> > changeset:   21907:6a0dd2c29999
> > parent:      21904:9f49667fec71
> > user:        Ian Campbell <ian.campbell@xxxxxxxxxx>
> > date:        Fri Jul 30 16:20:48 2010 +0100
> > summary:     libxc: free thread specific hypercall buffer on
> > xc_interface_close
> >
> > I am going to revert this and leave it to Ian to fix it properly
> > (currently on vacation).
>
> I'm currently looking at this but I'm not seeing this issue, xend starts
> up fine and I can start a (PV) VM.
>
> When you said "segfault on startup" did you mean of xend or of a domain?
> (I think the former).
>
> Can you give me a little more information about your environment please?
> Is it NetBSD by any chance?
>
> Please could you reapply this changeset add some tracing to
> hcall_buf_prep and _xc_clean_hcall_buf to print out the hcall_buff and
> hcall_buff->buf as they are allocated and freed. The line numbers
> indicate that the free(hcall_buf->buf) is faulting. We've just called
> unlock_pages on the same address but since we seem to deliberately throw
> away any errors from munlock (see "safe_munlock") that doesn't really
> tell us much about its validity.

I tracked down where the error happens. In safe_munlock(),
the munlock() fails.

The trace is:

xc_interface_close -> _xc_clean_hcall_buf -> unlock_pages -> safe_munlock -> 
munlock

hcall_buf->buf has the address 0x7f7ffdfe7040

In unlock_pages, the address and length passed to munlock() is:

 laddr 0x7f7ffdfe7000, llen 0x2000

The reason why munlock() fails is that mlock() hasn't been called before.
The hcall_buf_prep() is not called at all before the first call to 
_xc_clean_hcall_buf().

Christoph


-- 
---to satisfy European Law for business letters:
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach b. Muenchen
Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd
Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen
Registergericht Muenchen, HRB Nr. 43632


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel