From owner-cvs-all Sat Feb 15 21:42: 1 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4025537B401; Sat, 15 Feb 2003 21:41:59 -0800 (PST) Received: from ns1.xcllnt.net (209-128-86-226.BAYAREA.NET [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3305143FBF; Sat, 15 Feb 2003 21:41:58 -0800 (PST) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.6/8.12.6) with ESMTP id h1G5fv1o069831; Sat, 15 Feb 2003 21:41:57 -0800 (PST) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.7/8.12.7) with ESMTP id h1G5fv2r001986; Sat, 15 Feb 2003 21:41:57 -0800 (PST) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.7/8.12.7/Submit) id h1G5fv0c001985; Sat, 15 Feb 2003 21:41:57 -0800 (PST) Date: Sat, 15 Feb 2003 21:41:57 -0800 From: Marcel Moolenaar To: "Tim J. Robbins" Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/sh machdep.h memalloc.c nodes.c.pat Message-ID: <20030216054157.GA1973@athlon.pn.xcllnt.net> References: <200302160328.h1G3SB3s074208@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302160328.h1G3SB3s074208@repoman.freebsd.org> User-Agent: Mutt/1.5.3i Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Feb 15, 2003 at 07:28:11PM -0800, Tim J. Robbins wrote: > tjr 2003/02/15 19:28:11 PST > > Modified files: > bin/sh memalloc.c nodes.c.pat > Added files: > bin/sh machdep.h > Log: > Temporarily back out machdep.h/ALIGN changes. It seems that on sparc64, > using the alignment from sys/param.h (16) instead of the alignment > from machdep.h (8) tickled a nasty bug in the memory allocator that I > haven't been able to track down yet. I noticed that stalloc() in memalloc.c always yields an 8-byte aligned address due to the fact that the space field in struct stack_block is 8-byte aligned on 64-bit architectures. A fix for this would look something like: Index: memalloc.c =================================================================== RCS file: /home/ncvs/src/bin/sh/memalloc.c,v retrieving revision 1.19 diff -u -r1.19 memalloc.c --- memalloc.c 30 Jun 2002 05:15:03 -0000 1.19 +++ memalloc.c 16 Feb 2003 05:39:51 -0000 @@ -139,8 +139,8 @@ sp = ckmalloc(sizeof(struct stack_block) - MINSIZE + blocksize); sp->prev = stackp; - stacknxt = sp->space; - stacknleft = blocksize; + stacknxt = ALIGN(sp->space); + stacknleft = TRUNC(blocksize); stackp = sp; INTON; } I left TRUNC undefined. It's purpose is to adjust for the alignment of stacknxt. -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message