NetBSD Problem Report #35971

From tsutsui@ceres.dti.ne.jp  Sun Mar 11 00:44:49 2007
Return-Path: <tsutsui@ceres.dti.ne.jp>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 9620463BB32
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 11 Mar 2007 00:44:49 +0000 (UTC)
Message-Id: <200703110044.l2B0il37014931@mirage.ceres.dti.ne.jp>
Date: Sun, 11 Mar 2007 09:44:47 +0900 (JST)
From: tsutsui@ceres.dti.ne.jp
Reply-To: tsutsui@ceres.dti.ne.jp
To: gnats-bugs@NetBSD.org
Cc: tsutsui@ceres.dti.ne.jp
Subject: Mutex error on SH3 DIAGNOSTIC kernels
X-Send-Pr-Version: 3.95

>Number:         35971
>Category:       port-sh3
>Synopsis:       Mutex error panic on SH3 DIAGNOSTIC kernels
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sh3-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Mar 11 00:45:00 +0000 2007
>Closed-Date:    Mon Mar 12 11:02:47 +0000 2007
>Last-Modified:  Mon Mar 12 11:02:47 +0000 2007
>Originator:     Izumi Tsutsui
>Release:        NetBSD 4.99.13
>Organization:
>Environment:
NetBSD 4.99.13 (LANTANK) #6: Sun Mar 11 02:28:53 JST 2007
        tsutsui@mirage:/usr/src/sys/arch/landisk/compile/LANTANK
Model: I-O DATA LANDISK
Architecture: sh3
Machine: landisk
>Description:

landisk (and dreamcast) kernels with option DIAGNOSTIC get
the following panic (right after interrupts are enabled?):
---
 :
obio0 at mainbus0
btn0 at obio0 irq 12: USL-5P Button
pwrsw0 at obio0 irq 11: Power Switch
Kernelized RAIDframe activated
Mutex error: mutex_spin_retry: locking against myself

lock address : 0x000000008c3c6d8c
current cpu  :                  0
current lwp  : 000000000000000000
owner field  : 0x0000000038002000 wait/spin:                1/128

panic: lock error
Stopped at      netbsd:cpu_Debugger+0x6:        mov     r14, r15
db> tr
cpu_Debugger() at netbsd:panic+0xa6
panic() at netbsd:lockdebug_abort+0x40
lockdebug_abort() at netbsd:mutex_abort+0x4e
mutex_abort() at netbsd:mutex_spin_retry+0xe
mutex_spin_retry() at netbsd:sched_lock_idle+0x24
sched_lock_idle() at netbsd:cpu_switch_search+0x1a
cpu_switch_search() at netbsd:cpu_switch+0x24
cpu_switch() at 0
db> 
---

It's the first sched_lock_idle() in sys/arch/sh3/sh3/locore_c.c.

>How-To-Repeat:
Build kernel with options DIAGNOSTIC and boot it on landisk or dreamcast.

The panic is also reproducible on gxemul emulating dreamcast:
ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/emulators/gxemul/README.html
http://gavare.se/gxemul/gxemul-stable/doc/dreamcast.html

>Fix:
N/A

>Release-Note:

>Audit-Trail:
From: Andrew Doran <ad@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35971 CVS commit: src/sys/arch/sh3/sh3
Date: Sun, 11 Mar 2007 20:09:03 +0000 (UTC)

 Module Name:	src
 Committed By:	ad
 Date:		Sun Mar 11 20:09:03 UTC 2007

 Modified Files:
 	src/sys/arch/sh3/sh3: locore_c.c

 Log Message:
 PR port-sh3/35971: Mutex error on SH3 DIAGNOSTIC kernels


 To generate a diff of this commit:
 cvs rdiff -r1.16 -r1.17 src/sys/arch/sh3/sh3/locore_c.c

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

From: "Valeriy E. Ushakov" <uwe@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35971 CVS commit: src/sys/arch/sh3/sh3
Date: Mon, 12 Mar 2007 00:32:56 +0000 (UTC)

 Module Name:	src
 Committed By:	uwe
 Date:		Mon Mar 12 00:32:56 UTC 2007

 Modified Files:
 	src/sys/arch/sh3/sh3: locore_c.c locore_subr.S

 Log Message:
 Do cpu_exit with proper locking.

 Rename assembly cpu_exit to cpu_do_exit and make a C version of
 cpu_exit() to do proper locking.  While here, g/c switch_exit entry
 point and don't call lwp_exit2 from cpu_exit.
 From ad@

 Completes PR port-sh3/35971 - my Jornada now boots to multiuser with a
 LOCKDEBUG kernel.


 To generate a diff of this commit:
 cvs rdiff -r1.18 -r1.19 src/sys/arch/sh3/sh3/locore_c.c
 cvs rdiff -r1.31 -r1.32 src/sys/arch/sh3/sh3/locore_subr.S

 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: uwe@netbsd.org
State-Changed-When: Mon, 12 Mar 2007 00:38:05 +0000
State-Changed-Why:
With ad@ fixes my Jornada can boot a LOCKDEBUG kernel fine.
Please, move to closed if this fixes landisk for you (it's a bit
inconvenient to test it myself at the moment).


State-Changed-From-To: feedback->closed
State-Changed-By: tsutsui@netbsd.org
State-Changed-When: Mon, 12 Mar 2007 20:02:47 +0900
State-Changed-Why:
A landisk kernel with DIAGNOSTIC and LOCKDEBUG now works
at multi user.
The machine sometimes hangs up but maybe it's a different problem.


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