From: Ian Campbell Subject: Re: xend segfaults when starting Date: Wed, 18 Aug 2010 17:29:02 +0100 Message-ID: <1282148942.3170.1231.camel@zakaz.uk.xensource.com> References: <201008041512.12768.Christoph.Egger@amd.com> <201008181602.54286.Christoph.Egger@amd.com> <1282143570.3170.1053.camel@zakaz.uk.xensource.com> <201008181802.17563.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <201008181802.17563.Christoph.Egger@amd.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Christoph Egger Cc: "xen-devel@lists.xensource.com" , "Gianni Tedesco (3P)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Wed, 2010-08-18 at 17:02 +0100, Christoph Egger wrote: > > > > hcall_buf itself has the address 0x7f7ffdfe7000. > > > > > > hcall_buf->buf has the address 0x7f7ffdfe7040. > > > > That's very odd -- hcall_buf->buf is allocated with xc_memalign and > > therefore should be page aligned. Are you sure the addresses aren't > the > > other way round? > > Yes, I am. Then NetBSD has a bug where it apparently returns non-page aligned allocations from valloc. > Calling _xc_clean_hcall_buf() unconditionally and hcall_buf_prep() > conditionally sounds to me like calling free() unconditionally > and malloc() conditionally. Not quite because (in the updated patch) _xc_clean_hcall_buf() effectively contains a check to see if hcall_buf_prep() has been called. IOW it is OK for the same reason free(NULL) is OK. > Is it possible that xend can call xc_interface_close() during startup > and hcall_buf_prep() later when xend comes in interaction with xm ? Yes, but this is safe. Ian.