NetBSD Problem Report #45119

From www@NetBSD.org  Mon Jul  4 23:34:38 2011
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 E10CA63C892
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  4 Jul 2011 23:34:37 +0000 (UTC)
Message-Id: <20110704233437.4D1B763C882@www.NetBSD.org>
Date: Mon,  4 Jul 2011 23:34:37 +0000 (UTC)
From: cyber@netbsd.org
Reply-To: cyber@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: Assert Panic under -current running single proc under nfs load
X-Send-Pr-Version: www-1.0

>Number:         45119
>Category:       kern
>Synopsis:       Assert Panic under -current running single proc under nfs load
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    dholland
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 04 23:35:00 +0000 2011
>Closed-Date:    Tue Oct 04 07:17:54 +0000 2011
>Last-Modified:  Tue Oct 04 07:17:54 +0000 2011
>Originator:     Erik Berls
>Release:        -current July 4, 2011 14:30 PDT
>Organization:
NetBSD
>Environment:
NetBSD dev0 5.99.54 NetBSD 5.99.54 (GENERIC) #0: Mon Jul  4 07:57:10 PDT 2011  cyber@dev0:/n/srv0/Src/N-current/src/sys/arch/amd64/compile/obj/GENERIC amd64

(Ignore build timestamp, clock is set wrong.)
>Description:
Running single user mode (see port-amd64/45118) on a Dell C521 under NFS load caused a assert panic.  USB keyboard was non-functional in ddb, so further backtrace was not possible.  top and iostat were running.

NIC was a bge.  nfs client was a system running NetBSD 5.1.


panic: kernel diagnostic assertion "ccp - *(ap->a_cookies) < ccount" failed: file "/n/srv0/Src/N-current/src/sys/ufs/ufs/ufs_vnops.c", line 1749
fatal breakpoint trap in supervisor mode
trap type 1 code 0 rip ffffffff802404bd cs 8 rflags 246 cr2 ffff80000483d4000 cpl 0 rsp ffff800048def560
Stopped in pid 210.5 (nfsd) at netbsd:breakpoint+0x5: leave
db{0}>

>How-To-Repeat:
- boot system with -1 to disable SMP
- run as nfs server exporting a local volume
- on client ran ./build.sh cleandir
- watch server panic
>Fix:

>Release-Note:

>Audit-Trail:
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/45119: Assert Panic under -current running single proc
 under nfs load
Date: Tue, 5 Jul 2011 00:29:08 +0000

 On Mon, Jul 04, 2011 at 11:35:00PM +0000, cyber@netbsd.org wrote:
  > panic: kernel diagnostic assertion "ccp - *(ap->a_cookies) < ccount" failed: file "/n/srv0/Src/N-current/src/sys/ufs/ufs/ufs_vnops.c", line 1749

 If you feel brave, try the following patch, which I haven't tested yet
 but will commit once I have. If not, revert sys/sys/dirent.h -r1.25.

 Index: sys/sys/dirent.h
 ===================================================================
 RCS file: /cvsroot/src/sys/sys/dirent.h,v
 retrieving revision 1.25
 diff -u -r1.25 dirent.h
 --- sys/sys/dirent.h	23 May 2011 21:59:23 -0000	1.25
 +++ sys/sys/dirent.h	5 Jul 2011 00:21:42 -0000
 @@ -74,6 +74,13 @@
  #define	DT_WHT		14

  /*
 + * Caution: the following macros are used by the ufs/ffs code on ffs's
 + * struct direct as well as the exposed struct dirent. The two
 + * structures are not the same, so it's important (until ufs is fixed,
 + * XXX) that the macro definitions remain type-polymorphic.
 + */
 +
 +/*
   * The _DIRENT_ALIGN macro returns the alignment of struct dirent.
   * struct direct and struct dirent12 used 4 byte alignment but
   * struct dirent uses 8.
 @@ -84,7 +91,7 @@
   * struct dirent
   */
  #if __GNUC_PREREQ__(4, 0)
 -#define	_DIRENT_NAMEOFF(dp)	__builtin_offsetof(struct dirent, d_name)
 +#define	_DIRENT_NAMEOFF(dp)	__builtin_offsetof(__typeof(*dp), d_name)
  #else
  #define _DIRENT_NAMEOFF(dp) \
      ((char *)(void *)&(dp)->d_name - (char *)(void *)dp)


 -- 
 David A. Holland
 dholland@netbsd.org

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/45119 CVS commit: src/sys/sys
Date: Tue, 5 Jul 2011 07:32:34 +0000

 Module Name:	src
 Committed By:	dholland
 Date:		Tue Jul  5 07:32:34 UTC 2011

 Modified Files:
 	src/sys/sys: dirent.h

 Log Message:
 The manipulation macros for struct dirent are also used by the ufs/ffs
 code to manipulate the similar but not identical struct direct. For
 this reason they must remain type-polymorphic. Rev 1.25 broke that
 property, so put it back by using typeof. Fixes PR 45119.


 To generate a diff of this commit:
 cvs rdiff -u -r1.25 -r1.26 src/sys/sys/dirent.h

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

State-Changed-From-To: open->feedback
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 05 Jul 2011 07:36:29 +0000
State-Changed-Why:
Please check that it works now... might be other things wrong too


Responsible-Changed-From-To: kern-bug-people->dholland
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Tue, 05 Jul 2011 07:37:01 +0000
Responsible-Changed-Why:
I fixed it


State-Changed-From-To: feedback->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 04 Oct 2011 07:17:54 +0000
State-Changed-Why:
Fixed.


>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.