From owner-freebsd-arm@FreeBSD.ORG Thu Jan 18 19:07:57 2007 Return-Path: X-Original-To: freebsd-arm@freebsd.org Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D935016A412 for ; Thu, 18 Jan 2007 19:07:57 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (cognet.ci0.org [80.65.224.102]) by mx1.freebsd.org (Postfix) with ESMTP id 34C7D13C468 for ; Thu, 18 Jan 2007 19:07:56 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (localhost.ci0.org [127.0.0.1]) by dong.ci0.org (8.13.7/8.13.4) with ESMTP id l0IJINjt042749; Thu, 18 Jan 2007 20:18:24 +0100 (CET) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.13.8/8.13.8/Submit) id l0IJINMn042748; Thu, 18 Jan 2007 20:18:23 +0100 (CET) (envelope-from mlfbsd) Date: Thu, 18 Jan 2007 20:18:23 +0100 From: Olivier Houchard To: ticso@cicely.de Message-ID: <20070118191823.GB42638@ci0.org> References: <20070111101528.GV80390@cicely12.cicely.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070111101528.GV80390@cicely12.cicely.de> User-Agent: Mutt/1.4.1i Cc: Bernd Walter , freebsd-arm@freebsd.org Subject: Re: memcpy limitation X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2007 19:07:57 -0000 On Thu, Jan 11, 2007 at 11:15:28AM +0100, Bernd Walter wrote: > I get a sigbus with the following: > #0 0x00033158 in $a () at lcp.c:939 > 939 memcpy(&req, opt, sizeof req); > (gdb) print req > $1 = {hdr = {id = 0 '\0', len = 0 '\0'}, proto = 0, period = 0} > (gdb) print &req > $2 = (struct lqrreq *) 0xbfffe4a0 > (gdb) print opt > $3 = (struct fsm_opt *) 0xbfffe5b6 > > Shouldn't memcpy work with any alignment? > It certainly does. Would you have a simple test case which reproduce this ? Or does it happen as soon as you try to do an unaligned copy ? I'm quite confused on why it would happen, memcpy is shared between the kernel and the userland, and in kernel I'm sure it does unaligned copies. Thanks, Olivier