From owner-freebsd-sparc64@FreeBSD.ORG Thu May 29 18:24:24 2003 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 570DC37B401 for ; Thu, 29 May 2003 18:24:24 -0700 (PDT) Received: from mail.gmx.net (mail.gmx.de [213.165.65.60]) by mx1.FreeBSD.org (Postfix) with SMTP id 039BB43F93 for ; Thu, 29 May 2003 18:24:23 -0700 (PDT) (envelope-from tmoestl@gmx.net) Received: (qmail 8980 invoked by uid 65534); 30 May 2003 01:24:21 -0000 Received: from p508E67DF.dip.t-dialin.net (EHLO galatea.local) (80.142.103.223) by mail.gmx.net (mp002) with SMTP; 30 May 2003 03:24:21 +0200 Received: from tmm by galatea.local with local (Exim 4.20 #1) id 19LYdn-0000gO-Ae; Fri, 30 May 2003 03:25:07 +0200 Date: Fri, 30 May 2003 03:25:07 +0200 From: Thomas Moestl To: Kris Kennaway , Garance A Drosihn , freebsd-sparc64@freebsd.org Message-ID: <20030530012506.GA662@crow.dom2ip.de> Mail-Followup-To: Kris Kennaway , Garance A Drosihn , freebsd-sparc64@freebsd.org References: <20030528214711.GA94049@rot13.obsecurity.org> <20030528220215.GA94270@rot13.obsecurity.org> <20030528222144.GA667@crow.dom2ip.de> <20030528222244.GA94418@rot13.obsecurity.org> <20030528234914.GA1987@crow.dom2ip.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ckj6UjgE2iN1+kY" Content-Disposition: inline In-Reply-To: <20030528234914.GA1987@crow.dom2ip.de> User-Agent: Mutt/1.4.1i Sender: Thomas Moestl Subject: Re: portversion/portupgrade X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2003 01:24:24 -0000 --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, 2003/05/29 at 01:49:14 +0200, Thomas Moestl wrote: > On Wed, 2003/05/28 at 15:22:44 -0700, Kris Kennaway wrote: > > On Thu, May 29, 2003 at 12:21:44AM +0200, Thomas Moestl wrote: > > > On Wed, 2003/05/28 at 15:02:15 -0700, Kris Kennaway wrote: > > > > On Wed, May 28, 2003 at 05:55:09PM -0400, Garance A Drosihn wrote: > > > > > Do you know if this a bug in ruby itself, or is it only in > > > > > portversion && portupgrade? Is it only happening on sparc64? > > > > > > > > It's apparently a bug in ruby on sparc64. I don't think the bug > > > > exists on other 64-bit platforms, so it might be an endianness bug. > > > > > > I believe that this is fixed in ruby-devel. > > > > Hmm, I thought knu made a change to bsd.ruby.mk some time ago that > > switched sparc64 over to using ruby-devel, but the problem persists > > with freshly-built ports. > > Hmmm, yes, I must have misremebered that. > The bug really seems to be in ruby-bdb1, which is also marked > NOT_FOR_ARCHS=sparc64. To follow up on this, it seems that ruby_bdb1 is not at fault; the error is in our libc db code. The attached patch should fix it. I'll try to get approval to commit it. - Thomas -- Thomas Moestl http://www.tu-bs.de/~y0015675/ http://people.FreeBSD.org/~tmm/ PGP fingerprint: 1C97 A604 2BD0 E492 51D0 9C0F 1FE6 4F1D 419C 776C --4Ckj6UjgE2iN1+kY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="btree.diff" Index: lib/libc/db/btree/bt_put.c =================================================================== RCS file: /vol/ncvs/src/lib/libc/db/btree/bt_put.c,v retrieving revision 1.3 diff -u -r1.3 bt_put.c --- lib/libc/db/btree/bt_put.c 16 Feb 2003 17:29:09 -0000 1.3 +++ lib/libc/db/btree/bt_put.c 30 May 2003 00:10:25 -0000 @@ -78,7 +78,7 @@ PAGE *h; indx_t index, nxtindex; pgno_t pg; - u_int32_t nbytes; + u_int32_t nbytes, tmp; int dflags, exact, status; char *dest, db[NOVFLSIZE], kb[NOVFLSIZE]; @@ -131,8 +131,9 @@ tkey.data = kb; tkey.size = NOVFLSIZE; memmove(kb, &pg, sizeof(pgno_t)); + tmp = key->size; memmove(kb + sizeof(pgno_t), - &key->size, sizeof(u_int32_t)); + &tmp, sizeof(u_int32_t)); dflags |= P_BIGKEY; key = &tkey; } @@ -142,8 +143,9 @@ tdata.data = db; tdata.size = NOVFLSIZE; memmove(db, &pg, sizeof(pgno_t)); + tmp = data->size; memmove(db + sizeof(pgno_t), - &data->size, sizeof(u_int32_t)); + &tmp, sizeof(u_int32_t)); dflags |= P_BIGDATA; data = &tdata; } --4Ckj6UjgE2iN1+kY--