NetBSD Problem Report #38139
From martin@duskware.de Sun Mar 2 16:05:16 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 4A66D63B90D
for <gnats-bugs@gnats.netbsd.org>; Sun, 2 Mar 2008 16:05:16 +0000 (UTC)
Message-Id: <20080302155628.D27A663B90D@narn.NetBSD.org>
Date: Sun, 2 Mar 2008 15:56:28 +0000 (UTC)
From: sainio@t-online.de
Reply-To: sainio@t-online.de
To: netbsd-bugs-owner@NetBSD.org
Subject: hpcmips 4.99.55: mutex_vector_enter: locking against myself
X-Send-Pr-Version: www-1.0
>Number: 38139
>Category: port-hpcmips
>Synopsis: hpcmips 4.99.55: mutex_vector_enter: locking against myself
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: tsutsui
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Mar 02 16:10:00 +0000 2008
>Closed-Date: Fri Apr 04 12:38:22 +0000 2008
>Last-Modified: Fri Apr 04 12:40:01 +0000 2008
>Originator: Risto Sainio
>Release: -current == 4.99.55
>Organization:
>Environment:
NetBSD 4.99.55 (TX3922) #3: Sun Mar 2 17:08:14 CET 2008
root@vrsa95:/usr/objdir_current/sys/arch/hpcmips/compile/TX3922
build.sh started: Sun Mar 2 16:56:30 CET 2008
NetBSD version: 4.99.55
MACHINE: hpcmips
MACHINE_ARCH: mipsel
Build platform: NetBSD 4.0 i386
HOST_SH: /bin/sh
TOOLDIR path: /usr/src_current/../tooldir_current
DESTDIR path: /usr/src_current/../destdir_current
RELEASEDIR path: /usr/src_current/../releasedir_current
makewrapper: /usr/src_current/../tooldir_current/bin/nbmake-hpcmips
Updated /usr/src_current/../tooldir_current/bin/nbmake-hpcmips
Building kernel without building new tools
Building kernel: TX3922
Build directory: /usr/src_current/../objdir_current/sys/arch/hpcmips/compile/TX39
Kernels built from TX3922:
/usr/src_current/../objdir_current/sys/arch/hpcmips/compile/TX3922/netbsd
build.sh ended: Sun Mar 2 17:08:22 CET 2008
>Description:
copying a file to fs on wd-device panics the kernel. The wd-device is a CF-card in PCMCIA-slot. The hardware is a Fujitsu Pencentra 200. The rootfs is NFS-mounted so that this problem does not effect my testing. AFAIR, the 4.0-released kernel did not have this problem.
The kernel drops into db:
Mutex error: mutex_vector_enter: locking against myself
lock address : 0x0000000083a57b10
current cpu : 0
current lwp : 0x00000000836f3200
owner field : 0x00000000836f3200 wait/spin: 0/0
panic: lock error
Stopped in pid 298.1 (rsync) at netbsd:cpu_Debugger+0x4: jr ra
bdslot: nop
db> trace
cpu_Debugger+4 (83fef000,1,5,0) ra 8019bb5c sz 0
panic+210 (83fef000,1,1,0) ra 80195124 sz 48
lockdebug_abort+84 (83fef000,1,1,0) ra 80174744 sz 56
mutex_vector_enter+ac (83fef000,1,1,0) ra 801c2e28 sz 40
biodone2+34 (83fef000,1,1,0) ra 8021bb0c sz 32
wddone+2dc (83fef000,1,1,0) ra 8021c618 sz 48
wdc_ata_bio_done+9c (83fef000,1,1,0) ra 8021ce74 sz 40
wdc_ata_bio_intr+238 (83fef000,1,1,0) ra 800a39b4 sz 56
wdcintr+94 (83fef000,1,1,0) ra 80230814 sz 32
plumicu_intr+fc (83fef000,1,1,0) ra 8022b14c sz 48
cpu_intr+150 (83fef000,1,1,0) ra 801fe08c sz 40
mips1_KernIntr+84 (83a57b10,0,ffffff77,0) ra 801da01c sz 128
genfs_getpages+100c (ce0b3c60,0,ffffff77,0) ra 801d65c4 sz 280
VOP_GETPAGES+60 (83a57b10,0,2a6000,0) ra 8012ff90 sz 64
ubc_alloc+3e8 (83a57b10,0,2a6000,0) ra 0 sz 104
User-level: pid 298.1
db> ps
PID PPID PGRP UID S FLAGS LWPS COMMAND WAIT
>298 314 307 0 2 0 1 rsync
314 307 307 0 2 0 1 rsync
307 262 307 0 2 0x4000 1 rsync select
262 271 262 0 2 0x4000 1 csh pause
271 272 271 500 2 0x4100 1 su wait
272 278 272 500 2 0x4000 1 sh wait
278 269 269 500 2 0x100 1 sshd select
269 238 269 0 2 0x4101 1 sshd netio
259 1 259 0 2 0x4000 1 getty tty
264 1 264 0 2 0x4000 1 getty tty
265 1 265 0 2 0 1 cron nanoslp
245 1 245 0 2 0 1 inetd kqread
238 1 238 0 2 0 1 sshd select
107 1 107 0 2 0 1 syslogd kqread
1 0 1 0 2 0x4001 1 init wait
0 -1 0 0 2 0x20002 25 system *
db> reboot
cpu_reboot+34 (0,0,802f0000,ce0b36e4) ra 8007ad94 sz 24
db_reboot_cmd+4c (0,0,802f0000,ce0b36e4) ra 8007aa74 sz 32
db_command+30c (0,0,802f0000,ce0b36e4) ra 8007abc4 sz 168
db_command_loop+108 (0,0,802f0000,ce0b36e4) ra 8007da48 sz 88
db_trap+118 (0,0,802f0000,ce0b36e4) ra 801fff18 sz 32
kdb_trap+48 (0,0,802f0000,ce0b36e4) ra 80202fdc sz 32
trap+4f8 (ff10,0,802f0000,ce0b36e4) ra 801fdd80 sz 120
mips1_KernGenException+c0 (83fef000,1,5,0) ra 8019bb5c sz 128
panic+210 (83fef000,1,1,0) ra 80195124 sz 48
lockdebug_abort+84 (83fef000,1,1,0) ra 80174744 sz 56
mutex_vector_enter+ac (83fef000,1,1,0) ra 801c2e28 sz 40
biodone2+34 (83fef000,1,1,0) ra 8021bb0c sz 32
wddone+2dc (83fef000,1,1,0) ra 8021c618 sz 48
wdc_ata_bio_done+9c (83fef000,1,1,0) ra 8021ce74 sz 40
wdc_ata_bio_intr+238 (83fef000,1,1,0) ra 800a39b4 sz 56
wdcintr+94 (83fef000,1,1,0) ra 80230814 sz 32
plumicu_intr+fc (83fef000,1,1,0) ra 8022b14c sz 48
cpu_intr+150 (83fef000,1,1,0) ra 801fe08c sz 40
mips1_KernIntr+84 (83a57b10,0,ffffff77,0) ra 801da01c sz 128
genfs_getpages+100c (ce0b3c60,0,ffffff77,0) ra 801d65c4 sz 280
VOP_GETPAGES+60 (83a57b10,0,2a6000,0) ra 8012ff90 sz 64
ubc_alloc+3e8 (83a57b10,0,2a6000,0) ra 0 sz 104
User-level: pid 298.1
kloader: kernel file name: /netbsd
>How-To-Repeat:
rsa02# mount /dev/wd0a /mnt
rsa02# rsync -avH /nfsroot/ /mnt
building file list ... done
./
netbsd
>Fix:
>Release-Note:
>Audit-Trail:
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
To: gnats-bugs@NetBSD.org
Cc: port-hpcmips-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
Subject: Re: port-hpcmips/38139: hpcmips 4.99.55: mutex_vector_enter: locking
against myself
Date: Sun, 23 Mar 2008 03:04:57 +0900
> >Synopsis: hpcmips 4.99.55: mutex_vector_enter: locking against myself
Try the attached patch.
---
Izumi Tsutsui
Index: hpcmips/interrupt.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/hpcmips/interrupt.c,v
retrieving revision 1.11
diff -u -r1.11 interrupt.c
--- hpcmips/interrupt.c 3 Dec 2007 15:33:43 -0000 1.11
+++ hpcmips/interrupt.c 22 Mar 2008 17:58:15 -0000
@@ -73,11 +73,7 @@
void
cpu_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipending)
{
- struct cpu_info *ci;
- ci = curcpu();
- ci->ci_idepth++;
(*platform.cpu_intr)(status, cause, pc, ipending);
- ci->ci_idepth--;
}
#endif /* VR41XX && TX39XX */
Index: tx/tx39icu.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/tx/tx39icu.c,v
retrieving revision 1.23
diff -u -r1.23 tx39icu.c
--- tx/tx39icu.c 3 Dec 2007 15:33:44 -0000 1.23
+++ tx/tx39icu.c 22 Mar 2008 17:58:15 -0000
@@ -315,9 +315,12 @@
{
struct tx39icu_softc *sc;
tx_chipset_tag_t tc;
+ struct cpu_info *ci;
txreg_t reg, pend, *regs;
int i, j;
+ ci = curcpu();
+ ci->ci_idepth++;
uvmexp.intrs++;
#ifdef __HAVE_FAST_SOFTINTS
@@ -417,6 +420,9 @@
#ifdef __HAVE_FAST_SOFTINTS
softintr:
+#endif
+ ci->ci_idepth--;
+#ifdef __HAVE_FAST_SOFTINTS
_splset((status & ~cause & MIPS_HARD_INT_MASK) | MIPS_SR_INT_IE);
softintr(ipending);
#endif
Index: vr/vr.c
===================================================================
RCS file: /cvsroot/src/sys/arch/hpcmips/vr/vr.c,v
retrieving revision 1.50
diff -u -r1.50 vr.c
--- vr/vr.c 4 Jan 2008 22:13:57 -0000 1.50
+++ vr/vr.c 22 Mar 2008 17:58:15 -0000
@@ -532,6 +532,10 @@
void
VR_INTR(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t ipending)
{
+ struct cpu_info *ci;
+
+ ci = curcpu();
+ ci->ci_idepth++;
uvmexp.intrs++;
/* Deal with unneded compare interrupts occasionally so that we can
@@ -553,6 +557,7 @@
_splset(MIPS_INT_MASK_1|MIPS_SR_INT_IE);
(*vr_intr_handler[0])(vr_intr_arg[0], pc, status);
}
+ ci->ci_idepth--;
#ifdef __HAVE_FAST_SOFTINTS
if (ipending & MIPS_SOFT_INT_MASK_1) {
Responsible-Changed-From-To: port-hpcmips-maintainer->tsutsui
Responsible-Changed-By: tsutsui@NetBSD.org
Responsible-Changed-When: Fri, 28 Mar 2008 00:47:13 +0900
Responsible-Changed-Why:
State-Changed-From-To: open->feedback
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 28 Mar 2008 00:47:13 +0900
State-Changed-Why:
awaiting feedback.
From: Risto Sainio <sainio@t-online.de>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-hpcmips/38139: hpcmips 4.99.55: mutex_vector_enter: locking against myself
Date: Thu, 3 Apr 2008 21:46:25 +0200
Thanks again
I first reproduced the error, applied the patch, rebooted and tried to
reproduce the error again, but it did not occur. This is on tx3922-platform
and I did not test on VR-platform.
regards
Risto Sainio
On Saturday 22 March 2008 19:10, Izumi Tsutsui wrote:
> The following reply was made to PR port-hpcmips/38139; it has been noted by
> GNATS.
>
> From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
> To: gnats-bugs@NetBSD.org
> Cc: port-hpcmips-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
> netbsd-bugs@NetBSD.org, tsutsui@ceres.dti.ne.jp
> Subject: Re: port-hpcmips/38139: hpcmips 4.99.55: mutex_vector_enter:
> locking against myself
> Date: Sun, 23 Mar 2008 03:04:57 +0900
>
> > >Synopsis: hpcmips 4.99.55: mutex_vector_enter: locking against
> > > myself
>
> Try the attached patch.
> ---
> Izumi Tsutsui
>
>
> Index: hpcmips/interrupt.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/hpcmips/hpcmips/interrupt.c,v
> retrieving revision 1.11
> diff -u -r1.11 interrupt.c
> --- hpcmips/interrupt.c 3 Dec 2007 15:33:43 -0000 1.11
> +++ hpcmips/interrupt.c 22 Mar 2008 17:58:15 -0000
> @@ -73,11 +73,7 @@
> void
> cpu_intr(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t
> ipending) {
> - struct cpu_info *ci;
>
> - ci = curcpu();
> - ci->ci_idepth++;
> (*platform.cpu_intr)(status, cause, pc, ipending);
> - ci->ci_idepth--;
> }
> #endif /* VR41XX && TX39XX */
> Index: tx/tx39icu.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/hpcmips/tx/tx39icu.c,v
> retrieving revision 1.23
> diff -u -r1.23 tx39icu.c
> --- tx/tx39icu.c 3 Dec 2007 15:33:44 -0000 1.23
> +++ tx/tx39icu.c 22 Mar 2008 17:58:15 -0000
> @@ -315,9 +315,12 @@
> {
> struct tx39icu_softc *sc;
> tx_chipset_tag_t tc;
> + struct cpu_info *ci;
> txreg_t reg, pend, *regs;
> int i, j;
>
> + ci = curcpu();
> + ci->ci_idepth++;
> uvmexp.intrs++;
>
> #ifdef __HAVE_FAST_SOFTINTS
> @@ -417,6 +420,9 @@
>
> #ifdef __HAVE_FAST_SOFTINTS
> softintr:
> +#endif
> + ci->ci_idepth--;
> +#ifdef __HAVE_FAST_SOFTINTS
> _splset((status & ~cause & MIPS_HARD_INT_MASK) | MIPS_SR_INT_IE);
> softintr(ipending);
> #endif
> Index: vr/vr.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/hpcmips/vr/vr.c,v
> retrieving revision 1.50
> diff -u -r1.50 vr.c
> --- vr/vr.c 4 Jan 2008 22:13:57 -0000 1.50
> +++ vr/vr.c 22 Mar 2008 17:58:15 -0000
> @@ -532,6 +532,10 @@
> void
> VR_INTR(u_int32_t status, u_int32_t cause, u_int32_t pc, u_int32_t
> ipending) {
> + struct cpu_info *ci;
> +
> + ci = curcpu();
> + ci->ci_idepth++;
> uvmexp.intrs++;
>
> /* Deal with unneded compare interrupts occasionally so that we can
> @@ -553,6 +557,7 @@
> _splset(MIPS_INT_MASK_1|MIPS_SR_INT_IE);
> (*vr_intr_handler[0])(vr_intr_arg[0], pc, status);
> }
> + ci->ci_idepth--;
>
> #ifdef __HAVE_FAST_SOFTINTS
> if (ipending & MIPS_SOFT_INT_MASK_1) {
State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Fri, 04 Apr 2008 21:38:22 +0900
State-Changed-Why:
Fixed, thanks.
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/38139 CVS commit: src/sys/arch/hpcmips
Date: Fri, 4 Apr 2008 12:36:06 +0000 (UTC)
Module Name: src
Committed By: tsutsui
Date: Fri Apr 4 12:36:06 UTC 2008
Modified Files:
src/sys/arch/hpcmips/hpcmips: interrupt.c
src/sys/arch/hpcmips/tx: tx39icu.c
src/sys/arch/hpcmips/vr: vr.c
Log Message:
Account ci_idepth in VR_INTR() and TX_INTR, rather than cpu_intr() in
hpcmips/interrupt.c. The latter one is used only on kernels configured for
multiple CPUs (i.e. kernels which have both options VR41XX and TX39XX).
Closes PR port-hpcmips/38139 from Risto Sainio.
To generate a diff of this commit:
cvs rdiff -r1.11 -r1.12 src/sys/arch/hpcmips/hpcmips/interrupt.c
cvs rdiff -r1.23 -r1.24 src/sys/arch/hpcmips/tx/tx39icu.c
cvs rdiff -r1.50 -r1.51 src/sys/arch/hpcmips/vr/vr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
>Unformatted:
(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.