From owner-svn-src-all@FreeBSD.ORG Thu Jun 16 15:23:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3755E1065687; Thu, 16 Jun 2011 15:23:55 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id A65E38FC19; Thu, 16 Jun 2011 15:23:54 +0000 (UTC) Received: by vws18 with SMTP id 18so1769849vws.13 for ; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=OpM/7Zl6BfLIYht2At9GyZt8We9Rgtxzci9/8x4L38I=; b=kYqvZGj1kU/LKAKhdNTAStnvi5nh0wrX08X96NNLEn+OOa00eRhifxLK8viHVMbWun az0EZ80N0f8bCa4TNyJcJRmLE56ZSB/STSjbaqShouinLpShaj74MZnDrWeQeJOEdeja 2Iz+rQNJe/qUBY6tjpfhfrUX69AehYKeNWFhk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Hh/6uDf8GwZ3zdBoHKcrvcsYhrOyE9y27vheFBMdjMKjSinWMNNN2Y+pFRKSUzA+h8 vPY7qxIPh/0kNW9xU7hDbJUU2dt8YwSpt36J2G42/wGEOgq1ptzGWlE21aer2Ozh0rUJ vFFgBYkGTN91K/CRHzRXPrPmST5kzprK/6LKU= MIME-Version: 1.0 Received: by 10.220.210.69 with SMTP id gj5mr397098vcb.58.1308237833488; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) Received: by 10.220.189.202 with HTTP; Thu, 16 Jun 2011 08:23:53 -0700 (PDT) In-Reply-To: References: <201106160714.p5G7Etfx017112@svn.freebsd.org> <20110616180803.D1005@besplex.bde.org> <11061619555315.44181@www.mmlab.cse.yzu.edu.tw> <20110616235239.D1926@besplex.bde.org> Date: Thu, 16 Jun 2011 08:23:53 -0700 Message-ID: From: Garrett Cooper To: Bruce Evans Content-Type: multipart/mixed; boundary=0022154700ae58cacb04a5d5dba8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Tai-hwa Liang , src-committers@freebsd.org Subject: Re: svn commit: r223139 - head/lib/libstand X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2011 15:23:55 -0000 --0022154700ae58cacb04a5d5dba8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Jun 16, 2011 at 8:12 AM, Garrett Cooper wrote: > On Thu, Jun 16, 2011 at 7:06 AM, Bruce Evans wrote= : >> On Thu, 16 Jun 2011, Tai-hwa Liang wrote: >> >>> On Thu, 16 Jun 2011, Bruce Evans wrote: >>> >>>> On Thu, 16 Jun 2011, Garrett Cooper wrote: >>>>> >>>>> And you need to add #include to stand.h in order to get >>>>> uintmax_t. Here's a proper patch for amd64.. >>>> >>>> This would add namespace pollution. =A0stand.h doesn't use anything in >>>> . =A0It depends on normal namespace pollution in an XXX sect= ion >>>> in for the declaration of uintptr_t. =A0It and other hea= ders >>>> should use __uintptr_t instead. =A0Strangely, declares >>>> uintptr_t but not uintmax_t. >>> >>> =A0What about casting to __uintmax_t instead? >>> >>> Index: zalloc.c >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> --- zalloc.c =A0 =A0(revision 223146) >>> +++ zalloc.c =A0 =A0(working copy) >>> @@ -154,7 +154,7 @@ >>> =A0 =A0if ((char *)ptr < (char *)mp->mp_Base || >>> =A0 =A0 =A0 =A0(char *)ptr + bytes > (char *)mp->mp_End || >>> =A0 =A0 =A0 =A0((iaddr_t)ptr & MEMNODE_SIZE_MASK) !=3D 0) >>> - =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, bytes); >>> + =A0 =A0 =A0 panic("zfree(%p,%ju): wild pointer", ptr, (__uintmax_t)by= tes); >>> ... >> >> zalloc.c is not the (header) implementation, so it should not use the >> implementation detail (anything beginning with __). >> >> The latest tinderbox errors for this are hard to understand. =A0For amd6= 4 >> they say: >> >>> /src/lib/libstand/zalloc.c: In function 'zfree': >>> /src/lib/libstand/zalloc.c:157: warning: format '%ju' expects type >>> 'uintmax_t', but argument 3 has type 'iaddr_t' >> >> but amd64 seems to be just like sparc64 -- both seem to declare all the >> types as `unsigned long' at the lowest level. =A0I would expect all 64-b= it >> arches to do this, although this is logically wrong (it makes the larges= t >> integral type uintmax_t logically smaller than the standard bogus type >> unsigned long long). =A0This logic error is partly intentional (it detec= ts >> different type mismatches than uintmax_t =3D `unsigned long long' combin= ed >> with uint64_t =3D `unsigned long' would). > > =A0 =A0My second patch when applied gets one past tinderbox on powerpc.. > waiting for powerpc64 and sparc64 to complete. Namespace pollution is > one thing, but stdint.h isn't that bad IMHO -- I just find it funny > that iaddr_t had to be typedef'ed to uintptr_t in the first place. This needs to be committed to unbreak ia64 and mips64*. Still waiting to see what happens with sparc64, but amd64 and powerpc64 were oddly happy without this, even though they should have failed along with ia64 and mips64* (the format string should have been %zu for a size_t type). Will rerun universe once it completes on amd64, ia64 and sparc64 though later on today.. Thanks! -Garrett --0022154700ae58cacb04a5d5dba8 Content-Type: text/x-patch; charset=US-ASCII; name="fix-libstand-zalloc_malloc-ia64+mips64.patch" Content-Disposition: attachment; filename="fix-libstand-zalloc_malloc-ia64+mips64.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gozuw1d90 SW5kZXg6IGxpYi9saWJzdGFuZC96YWxsb2NfbWFsbG9jLmMKPT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gbGliL2xp YnN0YW5kL3phbGxvY19tYWxsb2MuYwkocmV2aXNpb24gMjIzMTQwKQorKysgbGliL2xpYnN0YW5k L3phbGxvY19tYWxsb2MuYwkod29ya2luZyBjb3B5KQpAQCAtMTEwLDcgKzExMCw3IEBACiAJICAg IHJldHVybjsKIAl9CiAJaWYgKCooKHNpZ25lZCBjaGFyICopcmVzICsgcmVzLT5nYV9CeXRlcyAt IDEpICE9IC0yKQotCSAgICBwYW5pYygiZnJlZTogZ3VhcmQyIGZhaWwgQCAlcCArICVkIGZyb20g JXM6JWQiLCBwdHIsIHJlcy0+Z2FfQnl0ZXMgLSBNQUxMT0NBTElHTiwgZmlsZSwgbGluZSk7CisJ ICAgIHBhbmljKCJmcmVlOiBndWFyZDIgZmFpbCBAICVwICsgJXp1IGZyb20gJXM6JWQiLCBwdHIs IHJlcy0+Z2FfQnl0ZXMgLSBNQUxMT0NBTElHTiwgZmlsZSwgbGluZSk7CiAJKigoc2lnbmVkIGNo YXIgKilyZXMgKyByZXMtPmdhX0J5dGVzIC0gMSkgPSAtMTsKICNlbmRpZgogCg== --0022154700ae58cacb04a5d5dba8--