NetBSD Problem Report #43028

From www@NetBSD.org  Sun Mar 21 05:22:40 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 2F93E63B86C
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 21 Mar 2010 05:22:40 +0000 (UTC)
Message-Id: <20100321052239.A594563B11D@www.NetBSD.org>
Date: Sun, 21 Mar 2010 05:22:39 +0000 (UTC)
From: dennis.c.ferguson@gmail.com
Reply-To: dennis.c.ferguson@gmail.com
To: gnats-bugs@NetBSD.org
Subject: CTASSERT() failure compiling kern/uipc_mbuf.c for powerpc64 - MSIZE too small
X-Send-Pr-Version: www-1.0

>Number:         43028
>Category:       port-powerpc
>Synopsis:       CTASSERT() failure compiling kern/uipc_mbuf.c for powerpc64 - MSIZE too small
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    mrg
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 21 05:25:00 +0000 2010
>Closed-Date:    Mon Mar 22 02:15:47 +0000 2010
>Last-Modified:  Mon Mar 22 02:20:05 +0000 2010
>Originator:     Dennis Ferguson
>Release:        very recent 5.99.24
>Organization:
>Environment:
NetBSD acer.hk.akit-ferguson.com 5.99.24 NetBSD 5.99.24 (GENERIC) #0: Sun Mar 14 17:25:30 HKT 2010  dennis@acer.hk.akit-ferguson.com:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
>Description:
When building for macppc64 the build fails with the following:

#   compile  librumpnet/uipc_mbuf.o
/usr/src/obj/tooldir.NetBSD-5.99.24-amd64/bin/powerpc64--netbsd-gcc -O -ffreestanding -fno-strict-aliasing -Wall -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare -Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter -Wno-format-zero-length -Wno-pointer-sign -Werror   -I/usr/src/lib/librumpnet/../../sys/rump/include  -D_RUMPKERNEL -D_KERNEL -DMULTIPROCESSOR -D_MODULE -DMODULAR -DMAXUSERS=32 -DDIAGNOSTIC -DCOMPAT_50 -DDEBUGPRINT -I/usr/src/lib/librumpnet -I. -I/usr/src/lib/librumpnet/../../sys/rump/../../common/include -I/usr/src/lib/librumpnet/../../sys/rump/../arch -I/usr/src/lib/librumpnet/../../sys/rump/include -I/usr/src/lib/librumpnet/../../sys/rump/librump/rumpkern/opt -nostdinc -I/usr/src/lib/librumpnet/../../sys/rump/.. -D__NetBSD__ -I/usr/src/lib/librumpnet/../../sys/rump/librump/rumpkern -I/usr/src/lib/librumpnet/../../sys/rump/librump/rumpnet/opt  -c    /usr/src/lib/l
 ibrumpnet/../../sys/rump/../kern/uipc_mbuf.c -o uipc_mbuf.o
/usr/src/lib/librumpnet/../../sys/rump/../kern/uipc_mbuf.c: In function 'mbinit':
/usr/src/lib/librumpnet/../../sys/rump/../kern/uipc_mbuf.c:190: error: size of array '__ctassert190' is negative
/usr/src/lib/librumpnet/../../sys/rump/../kern/uipc_mbuf.c:191: error: size of array '__ctassert191' is negative

*** Failed target:  uipc_mbuf.o

The assert indicates that the size of a struct mbuf is larger
than the size of an mbuf (i.e. MSIZE).
>How-To-Repeat:
Do a:

    MACHINE=macppc64 ./build.sh distribution
>Fix:
MSIZE needs to get bigger (the machine's page size could get
bigger instead, but that isn't anything worth thinking about
when there isn't even a powerpc64 kernel).

The following patch to arch/powerpc/include/param.h does this.

Index: param.h
===================================================================
RCS file: /cvsroot/src/sys/arch/powerpc/include/param.h,v
retrieving revision 1.21
diff -u -r1.21 param.h
--- param.h     8 Feb 2010 19:02:31 -0000       1.21
+++ param.h     21 Mar 2010 05:08:12 -0000
@@ -91,7 +91,11 @@
  * of the hardware page size.
  */
 #ifndef MSIZE
+#ifdef _LP64
+#define        MSIZE           512             /* size of an mbuf */
+#else  /* _LP64 */
 #define        MSIZE           256             /* size of an mbuf */
+#endif /* _LP64 */
 #endif
 #ifndef MCLSHIFT
 #define        MCLSHIFT        11              /* convert bytes to m_buf clusters */

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->analyzed
State-Changed-By: pooka@NetBSD.org
State-Changed-When: Sun, 21 Mar 2010 08:51:53 +0300
State-Changed-Why:
Note that a macppc64 kernel build fails with:
nbmkdep: /objs/tools/bin/powerpc--netbsd-gcc: not found: No such file or directo
ry

I wouldn't attempt to do anything with powerpc64 before elementary 
things like that are fixed.


Responsible-Changed-From-To: port-powerpc-maintainer->mrg
Responsible-Changed-By: mrg@NetBSD.org
Responsible-Changed-When: Sun, 21 Mar 2010 23:53:16 +0000
Responsible-Changed-Why:
and this one too...


State-Changed-From-To: analyzed->closed
State-Changed-By: mrg@NetBSD.org
State-Changed-When: Mon, 22 Mar 2010 02:15:47 +0000
State-Changed-Why:
fix applied, thanks!


From: matthew green <mrg@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43028 CVS commit: src/sys/arch/powerpc/include
Date: Mon, 22 Mar 2010 02:14:28 +0000

 Module Name:	src
 Committed By:	mrg
 Date:		Mon Mar 22 02:14:28 UTC 2010

 Modified Files:
 	src/sys/arch/powerpc/include: param.h

 Log Message:
 default powerpc64 mbufs to 512 bytes, like other 64 bit platforms.
 from dennis.c.ferguson@gmail.com in PR#43028.


 To generate a diff of this commit:
 cvs rdiff -u -r1.21 -r1.22 src/sys/arch/powerpc/include/param.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.