Subject: port-powerpc/16066: kernel panic as a result of DSI trap
To: None <gnats-bugs@gnats.netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 03/26/2002 11:05:32
>Number:         16066
>Category:       port-powerpc
>Synopsis:       [dM] DSI trap panics kernel
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-powerpc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 26 08:07:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     der Mouse
>Release:        Proprietary PPC port derived from 1.5W
>Organization:
	Dis-
>Environment:
	Proprietary PPC port derived from 1.5W
>Description:
	I've been asked to post this by a company that's been working
	with NetBSD.  I don't know much about the problem beyond what's
	here, as I did not see this myself, but I can get mail back to
	the actual originators.  (I realize this may seem to be a
	rather disorganized collection of information; it's what they
	sent me, and as I say, I didn't see it happen myself.  I'm not
	entirely sure why they asked me to post it instead of doing it
	themselves.  I'm trying to help them some in tracking it down
	myself; if anyone has any ideas, I/we would most appreciate
	hearing them.)

/*	$NetBSD: param.h,v 1.128 2001/06/03 02:48:45 thorpej Exp $	*/
    #define	__NetBSD_Version__	105230000	/* NetBSD 1.5W */
/*	$NetBSD: sys_process.c,v 1.67 2001/03/17 09:38:36 pooka Exp $	*/
/*	$NetBSD: kern_synch.c,v 1.104 2001/05/28 22:20:03 chs Exp $	*/
/*	$NetBSD: kern_lock.c,v 1.55 2001/06/05 04:38:09 thorpej Exp $	*/
/*	$NetBSD: uvm_fault_i.h,v 1.13 2001/06/02 18:09:26 chs Exp $	*/
/*	$NetBSD: uvm_map.h,v 1.28 2001/06/02 18:09:27 chs Exp $	*/
/*	$NetBSD: uvm_fault.c,v 1.64 2001/06/02 18:09:26 chs Exp $	*/
/*	$NetBSD: uvm_map.c,v 1.99 2001/06/02 18:09:26 chs Exp $	*/
/*	$NetBSD: uvm_io.c,v 1.15 2001/06/02 18:09:26 chs Exp $	*/
/*	$NetBSD: uvm_vnode.c,v 1.50 2001/05/26 21:27:21 chs Exp $	*/
/*	$NetBSD: procfs_mem.c,v 1.27 2000/11/24 18:58:37 chs Exp $	*/
/*	$NetBSD: layer_vnops.c,v 1.6 2001/06/07 13:32:47 wiz Exp $	*/

In platform-dependent part: arch/my_ppc
/*	$NetBSD: cpu.c,v 1.1 2000/02/29 15:21:46 nonaka Exp $	*/
/*	$NetBSD: locore.s,v 1.8 2000/11/16 05:38:33 thorpej Exp $	*/
/*	$NetBSD: machdep.c,v 1.11 2000/09/13 15:00:22 thorpej Exp $	*/
in arch/powerpc
/*	$NetBSD: Locore.c,v 1.4 2000/06/08 06:48:45 kleink Exp $	*/
/*	$NetBSD: locore_subr.S,v 1.2 2001/02/28 20:44:41 tsubai Exp $	*/
/*	$NetBSD: mem.c,v 1.9 2001/02/04 17:38:11 briggs Exp $ */
/*	$NetBSD: pmap.c,v 1.44 2001/06/10 11:01:27 tsubai Exp $	*/
/*	$NetBSD: powerpc_machdep.c,v 1.4 2001/04/05 09:58:05 tsubai Exp $	*/
/*	$NetBSD: process_machdep.c,v 1.5 2001/02/04 17:38:11 briggs Exp $	*/
/*	$NetBSD: sys_machdep.c,v 1.3 2000/06/09 14:08:45 kleink Exp $	*/
/*	$NetBSD: trap.c,v 1.46 2001/06/10 16:31:59 tsubai Exp $	*/
/*	$NetBSD: trap_subr.S,v 1.6 2001/06/08 00:16:25 matt Exp $	*/
/*	$NetBSD: trap_subr_mp.S,v 1.2 2001/06/10 11:09:28 tsubai Exp $	*/
/*	$NetBSD: vm_machdep.c,v 1.28 2001/06/10 11:01:28 tsubai Exp $	*/



bash-2.05# cd usr/local/bin/
bash-2.05# gdb my_shlib_test
GNU gdb 4.17
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc--netbsd"...
(gdb) Stopped at      cpu_Debugger+0x10:      lwz r0, r1, 0x14,
db> show uvmexp
Current UVM status:
  pagesize=4096 (0x1000), pagemask=0xfff, pageshift=12
  127784 VM pages: 3943 active, 0 inactive, 1940 wired, 112038 free
  min  10% (25) anon, 10% (25) vnode, 5% (12) vtext
  pages  3670 anon, 1176 vnode, 965 vtext
  freemin=64, free-target=85, inactive-target=0, wired-max=127784
  faults=17573, traps=0, intrs=0, ctxswitch=8624
  softint=3183, syscalls=41914, swapins=0, swapouts=0
  fault counts:
    noram=0, noanon=0, pgwait=0, pgrele=0
    ok relocks(total)=608(608), anget(retrys)=2112(0), amapcopy=1684
    neighbor anon/obj pg=1422/21454, gets(lock/unlock)=10403/608
    cases: anon=1345, anoncow=767, obj=6803, prcopy=3600, przero=4751
  daemon and swap counts:
    woke=0, revs=0, scans=0, obscans=0, anscans=0
    busy=0, freed=0, reactivate=0, deactivate=0
    pageouts=0, pending=0, nswget=0
    nswapdev=0, nanon=119381, nanonneeded=119381 nfreeanon=115711
    swpages=0, swpginuse=0, swpgonly=0 paging=0
  kernel pointers:
    objs(kern/kmem/mb)=0x140a74/0x140b70/0x140b88
db> cont

(gdb) set verbose 1
(gdb) set auto-solib-add 1
(gdb) r -N
Starting program: /usr/local/bin/my_shlib_test -N
trap: kernel read DSI @ 0xe0899c78 by 0xe6ce0 (DSISR 0x40000000)
Stopped in pid 78 (my_shlib_test) at    intrctlr_setpl+0x34:    lwz r9, r31, 0x44,
db> show uvmexp
Current UVM status:
  pagesize=4096 (0x1000), pagemask=0xfff, pageshift=12
  127784 VM pages: 4779 active, 0 inactive, 1944 wired, 111192 free
  min  10% (25) anon, 10% (25) vnode, 5% (12) vtext
  pages  3894 anon, 1266 vnode, 1487 vtext
  freemin=64, free-target=85, inactive-target=0, wired-max=127784
  faults=18321, traps=0, intrs=0, ctxswitch=10155
  softint=3783, syscalls=43185, swapins=0, swapouts=0
  fault counts:
    noram=0, noanon=0, pgwait=0, pgrele=0
    ok relocks(total)=773(773), anget(retrys)=2118(0), amapcopy=1752
    neighbor anon/obj pg=1423/22057, gets(lock/unlock)=10962/773
    cases: anon=1351, anoncow=767, obj=7153, prcopy=3809, przero=4903
  daemon and swap counts:
    woke=0, revs=0, scans=0, obscans=0, anscans=0
    busy=0, freed=0, reactivate=0, deactivate=0
    pageouts=0, pending=0, nswget=0
    nswapdev=0, nanon=119381, nanonneeded=119381 nfreeanon=115487
    swpages=0, swpginuse=0, swpgonly=0 paging=0
  kernel pointers:
    objs(kern/kmem/mb)=0x140a74/0x140b70/0x140b88
db> trace
at .Ltext42+14
saved LR(0xaf38) is invalid.
db> trace 78
at .Ltext42+14
saved LR(0xaf38) is invalid.
db>

db> ps /a
 PID          COMMAND      STRUCT PROC *            UAREA *     VMSPACE/VM_MAP
>How-To-Repeat:
	Unknown.
>Fix:
	Unknown.
>Release-Note:
>Audit-Trail:
>Unformatted:
 >78     my_shlib_test          0x476a1d8         0xefba9000          0x324b4b0
  77               gdb          0x476a730         0xefba5000          0x324b190
  76              bash          0x3277728         0xefb8f000          0x324b7d0
  74            crunch          0x3277560         0xefb8b000          0x324b0c8
  61            crunch          0x476a568         0xefba1000          0x324b708
  53            crunch          0x32778f0         0xefb9d000          0x324b640
  42            crunch          0x3277c80         0xefb98000          0x324b3e8
  34            crunch          0x3277ab8         0xefb94000          0x324b320
  11          aiodoned          0x3277398         0xefb86000           0x1596d0
  10           ioflush          0x32771d0         0xefb82000           0x1596d0
  9             reaper          0x3277008         0xefb7e000           0x1596d0
  8         pagedaemon          0x3246c78         0xefb7a000           0x1596d0
  7              nfsio          0x3246ab0         0xefb76000           0x1596d0
  6              nfsio          0x32468e8         0xefb72000           0x1596d0
  5              nfsio          0x3246720         0xefb6e000           0x1596d0
  4              nfsio          0x3246558         0xefb6a000           0x1596d0
  1             crunch          0x3246000         0xefb5e000          0x324b000
  0            swapper           0x159798           0x1bf000           0x1596d0
 db> ps /w
  PID          COMMAND     EMUL  PRI UTIME STIME WAIT-MSG    WAIT-CHANNEL
 >78     my_shlib_test   netbsd   53   0.1   0.2
  77               gdb   netbsd   32   0.4   0.3 wait        0x476a730
  76              bash   netbsd   32   0.0   0.0 wait        0x3277728
  74            crunch   netbsd   32   0.0   0.2 wait        0x3277560
  61            crunch   netbsd   24   0.0   0.0 select      selwait
  53            crunch   netbsd   24   0.5   0.0 select      selwait
  42            crunch   netbsd   24   0.0   0.3 select      selwait
  34            crunch   netbsd   32   0.0   0.1 mfsidl      0x3a6caa8
  11          aiodoned   netbsd    4   0.0   0.0 aiodoned    uvm+0x34
  10           ioflush   netbsd   40   0.0   0.0 syncer      rushjob
  9             reaper   netbsd    4   0.0   0.6 reaper      deadproc
  8         pagedaemon   netbsd    4   0.0   0.0 pgdaemon    uvm+0x28
  7              nfsio   netbsd   32   0.0   0.0 nfsidl      nfs_iodwant+0xc
  6              nfsio   netbsd   32   0.0   0.0 nfsidl      nfs_iodwant+0x8
  5              nfsio   netbsd   32   0.0   0.1 nfsidl      nfs_iodwant+0x4
  4              nfsio   netbsd   32   0.0   0.1 nfsidl      nfs_iodwant
  1             crunch   netbsd   32   0.0   0.1 wait        0x3246000
  0            swapper   netbsd    4   0.0   0.0 scheduler   proc0
 db>
 
 
 db> examine /x 0x476a1d8+1b8
  0x476a390:     efba9000
 db> show registers
 r0             0xe73f0  .Ltext43
 r1            0x1400e0  ddbstk+0x1d40
 r2                   0
 r3            0x156058  extctlr
 r4                 0xb
 r5                0x53  isisize+0x7
 r6                   0
 r7                0x10
 r8                   0
 r9             0xe6dd4  intrctlr_mask
 r10               0x18
 r11                0xb
 r12         0xffffffff
 r13                  0
 r14               0x10
 r15                  0
 r16                  0
 r17                  0
 r18                  0
 r19                  0
 r20           0x117a21  .LC6+0x1
 r21         0xffffec14
 r22         0xffffec08
 r23                0x1
 r24                  0
 r25         0xffffec64
 r26         0xffffec6c
 r27                  0
 r28          0x1000290  end+0xe94bdc
 r29                  0
 r30           0x140000  ddbstk+0x1c60
 r31         0xe0899c34
 iar            0xe6ce0  intrctlr_setpl+0x34
 msr             0x1030  tlbdsmsize+0xf48
 intrctlr_setpl+0x34:    lwz r9, r31, 0x44,
 db> examine /x efba9000,10
 0xefba9000:     e09e4380    5099380     efbac940    a           0           1
 0xefba9018:     0           0           0           0           0           0
 0xefba9030:     0           0           0           0
 db>
 The SPL = 0xa and SP=efbac940
 
 0xefbac940:     efbac9b0
 
 db> examine /x efbac9b0,10
 0xefbac9b0:     efbac9d0    
 				   96db8       
 			    24422022 R30   
 			      140000 R31      
 			    fffffffb R01   
 			           0 LR  
 0xefbac9c8:       1560a4      
                 e089b8c0    
                 efbac9f0    
                    e6e48       
                     2080        
                   160000      
                 efbaca00