NetBSD Problem Report #10059

Received: (qmail 1550 invoked from network); 6 May 2000 23:25:28 -0000
Message-Id: <200005062324.BAA23716@vader.runit.sintef.no>
Date: Sun, 7 May 2000 01:24:57 +0200 (MEST)
From: he@runit.no (Havard Eidnes)
Reply-To: he@runit.no (Havard Eidnes)
To: gnats-bugs@gnats.netbsd.org
Subject: synetbsd-INSTALL.gz fails with "panic: kernel fault"
X-Send-Pr-Version: 3.95

>Number:         10059
>Category:       port-sparc
>Synopsis:       synetbsd-INSTALL.gz fails with "panic: kernel fault"
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 06 23:26:00 +0000 2000
>Closed-Date:    Sun Jul 09 22:38:59 +0000 2000
>Last-Modified:  Sun Jul 09 22:38:59 +0000 2000
>Originator:     Havard Eidnes
>Release:        1.4.2
>Organization:
	RUNIT AS
>Environment:

System: SPARCsystem 600MP Series (2 X CY605C)
	Trying to boot NetBSD 1.4.2

>Description:
	Tried to boot this system using the network and the boot
	blocks from 1.4.2 resulted in the following panic/traceback:

<#0> ok boot net
Resetting ... 
SPARCsystem 600MP Series (2 X CY605C), No Keyboard
ROM Rev. 2.5, 128 MB memory installed, Serial #4196356.
Ethernet address 8:0:20:e:f7:94, Host ID: 71400804.


Rebooting with command: net                                           
Boot device: /iommu/sbus/lebuffer@f,40000/le@f,60000   File and args: 
13c00 
>How-To-Repeat:
	See above.

>Fix:
	Sorry; fixing at this level is beyond me...
	I'll however gladly test any modifications.

	For the record: booting the normal 1.4.2 GENERIC_SCSI3 kernel
	using the same setup as was used above works.
>Release-Note:
>Audit-Trail:

From: Havard.Eidnes@runit.sintef.no
To: he@runit.no
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: port-sparc/10059: synetbsd-INSTALL.gz fails with "panic: kernel fault"
Date: Sun, 07 May 2000 13:14:31 +0200

 > >Number:         10059
 > >Category:       port-sparc
 > >Synopsis:       synetbsd-INSTALL.gz fails with "panic: kernel fault"
 > ...
 >  >> NetBSD/sparc Secondary Boot, Revision 1.8
 >  >> (toddpw@threepio.toddpw.net, Fri Mar  3 17:51:31 PST 2000)
 >  boot: client IP address: 129.241.249.77
 >  boot: client name: anker.runit.no
 >  root addr=129.241.249.70 path=/var/tmp
 >  Booting netbsd @ 0x4000
 >  1056768+1738008+146404+[62268+71473]=0x2f2b71
 >  OBP version 3, revision 2.5 (plugin rev 2)
 >  [ preserving 133748 bytes of netbsd a.out symbol table ]
 >  console is ttya
 >  Copyright (c) 1996, 1997, 1998, 1999, 2000
 >      The NetBSD Foundation, Inc.  All rights reserved.
 >  Copyright (c) 1982, 1986, 1989, 1991, 1993
 >      The Regents of the University of California.  All rights reserved.
 >  
 >  data fault: pc=0xf00b8f9c addr=0x0 sfsr=1a6<PERR=0,LVL=1,AT=5,FT=1,FAV,OW>
 >  panic: kernel fault
 >  Stopped in  at  _Debugger+0x4:  jmpl            [%o7 + 0x8], %g0
 >  db>

 Hm, it appears you can't trust "trace" to give correct data in
 this case.  The PC given above points into uvm_pagealloc_strat,
 at uvm_pagealloc_strat+416:

 (gdb) i li 937
 Line 937 of "../../../../uvm/uvm_page.c"
    starts at address 0x1850 <uvm_pagealloc_strat+380>
    and ends at 0x1878 <uvm_pagealloc_strat+420>.
 (gdb) x/i
 0x1850 <uvm_pagealloc_strat+380>:       ld  [ %i0 ], %o1
 (gdb) 
 0x1854 <uvm_pagealloc_strat+384>:       cmp  %o1, 0
 (gdb) 
 0x1858 <uvm_pagealloc_strat+388>:       be  0x1868 <uvm_pagealloc_strat+404>
 (gdb) 
 0x185c <uvm_pagealloc_strat+392>:       ld  [ %i0 + 4 ], %o0
 (gdb) 
 0x1860 <uvm_pagealloc_strat+396>:       b  0x186c <uvm_pagealloc_strat+408>
 (gdb) 
 0x1864 <uvm_pagealloc_strat+400>:       st  %o0, [ %o1 + 4 ]
 (gdb) 
 0x1868 <uvm_pagealloc_strat+404>:       st  %o0, [ %o2 + 4 ]
 (gdb) 
 0x186c <uvm_pagealloc_strat+408>:       ld  [ %i0 + 4 ], %o1
 (gdb) 
 0x1870 <uvm_pagealloc_strat+412>:       ld  [ %i0 ], %o0
 (gdb) 
 0x1874 <uvm_pagealloc_strat+416>:       st  %o0, [ %o1 ]
 (gdb) 
 0x1878 <uvm_pagealloc_strat+420>:       mov  %l1, %o3
 (gdb)

 This points to the TAILQ_REMOVE in the below section:

 (gdb) l 937
 932                     panic("uvm_pagealloc_strat: bad strat %d", strat);
 933                     /* NOTREACHED */
 934             }
 935     
 936      gotit:
 937             TAILQ_REMOVE(freeq, pg, pageq);
 938             uvmexp.free--;
 939     
 940             uvm_unlock_fpageq();            /* unlock free page queue */
 941             splx(s);
 (gdb) 

 Now, *why* this happens is still a mystery to me.

 Regards,

 - Havard

From: Havard.Eidnes@runit.sintef.no
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: port-sparc/10059: synetbsd-INSTALL.gz fails with "panic: kernel fault"
Date: Sun, 07 May 2000 20:00:39 +0200

 More info:

 Created a kernel with the following test added:

  gotit:
 #if 1 
         if (pg->pageq.tqe_prev == NULL)
                 panic("uvm_pagealloc_strat: freeq busted");
 #endif
         TAILQ_REMOVE(freeq, pg, pageq);
         uvmexp.free--;

 and booting a kernel (stripped -- more about that below) results
 in this panic triggering:

 <#0> ok boot net
 Resetting ... 
 SPARCsystem 600MP Series (2 X CY605C), No Keyboard
 ROM Rev. 2.5, 128 MB memory installed, Serial #4196356.
 Ethernet address 8:0:20:e:f7:94, Host ID: 71400804.


 Rebooting with command: net                                           
 Boot device: /iommu/sbus/lebuffer@f,40000/le@f,60000   File and args: 
 13c00 
 >> NetBSD/sparc Secondary Boot, Revision 1.8
 >> (he@ken.runit.sintef.no, Fri Mar  3 19:42:53 MET 2000)
 boot: client IP address: 129.241.249.77
 boot: client name: anker.runit.no
 root addr=129.241.249.70 path=/var/tmp
 Booting netbsd @ 0x4000
 1056768+1885464+146404=0x2f60fc
 OBP version 3, revision 2.5 (plugin rev 2)
  [ no symbols available ]
 console is ttya
 Copyright (c) 1996, 1997, 1998, 1999, 2000
     The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

 panic: uvm_pagealloc_strat: freeq busted
 Stopped in  at  0xf00fd068:     jmpl            [%o7 + 0x8], %g0
 db> trace
 ?(0xf051e000, 0x6ac000, 0x0, 0x0, 0x0, 0x0) at 0xf00b8fac
 ?(0xf02d2ed8, 0x6ac000, 0x1, 0x0, 0x0, 0xf00f4510) at 0xf00b2828
 ?(0xf06ac000, 0xfe000000, 0xf02edfe0, 0x1, 0xf06ab7a4, 0xf02edfa8) at 0xf002c54c
 ?(0xf0110400, 0x1, 0xf0002000, 0xf010df20, 0xf010df18, 0x8) at 0xf00b1c8c
 ?(0x0, 0xf02ece70, 0xf00021b8, 0xf010e0a3, 0xffef201c, 0x0) at 0xf00262a8
 ?(0x1, 0x30c800, 0x301ee0, 0x0, 0x0, 0x8) at 0xf0007694
 db>

 Getting the corresponding symbols:

 (gdb) x/i 0xf00b8fac
 0xf00b8fac <uvm_pagealloc_strat+400>:   call  0xf0038564 <panic>
 (gdb) x/i 0xf00b2828
 0xf00b2828 <uvm_km_alloc1+244>: call  0xf00b8e1c <uvm_pagealloc_strat>
 (gdb) x/i 0xf002c54c
 0xf002c54c <kmeminit+16>:       call  0xf00b2734 <uvm_km_alloc1>
 (gdb) x/i 0xf00b1c8c
 0xf00b1c8c <uvm_init+104>:      call  0xf002c53c <kmeminit>
 (gdb) x/i 0xf00262a8
 0xf00262a8 <main+52>:   call  0xf00b1c24 <uvm_init>
 (gdb) x/i 0xf0007694
 0xf0007694 <startmap_done+460>: call  0xf0026274 <main>
 (gdb)


 I tried generating a sysinst-on-ramdisk kernel *with* debugging
 symbols, but the resulting kernel failed to load with

 Rebooting with command: net                                           
 Boot device: /iommu/sbus/lebuffer@f,40000/le@f,60000   File and args: 
 13c00 
 >> NetBSD/sparc Secondary Boot, Revision 1.8
 >> (he@ken.runit.sintef.no, Fri Mar  3 19:42:53 MET 2000)
 boot: client IP address: 129.241.249.77
 boot: client name: anker.runit.no
 root addr=129.241.249.70 path=/var/tmp
 Booting netbsd @ 0x4000
 1056768+1885464+146404+[62268Memory Address not Aligned
 Type  help  for more information
 <#0> ok 
 <#0> ok .locals
             0        1        2        3        4        5        6        7
 IN:      b0ef  5020000 f00d593c     b0f8  5020000 f008ac28     b104  9000000
 LOC:  7010000 f010e2a8     b0df  5020000 f0026274     b0e5  5020000 f00eee2c
 OUT:      400      400   2d8138   2ffd00      400   2d8138   2ffd70   3048f8
 <#0> ok .registers
           %g0      %g1      %g2      %g3      %g4      %g5      %g6      %g7
             0  8000000        0        0        1      fff    199b2     4000
            PC      nPC        Y      PSR      WIM      TBR
        304920   304924     8000 11001be2        8 ffefa070
 <#0> ok 304918 dis
 304918     beq     304944 
 30491c     or      %g0, %o4, %o1
 304920     ldd     [%i0 + 8], %o2
 304924     sra     %o4, 1f, %o0
 304928     addcc   %o3, %o1, %o3
 30492c     addx    %o2, %o0, %o2
 304930     sub     %i2, %o4, %i2
 304934     std     %o2, [%i0 + 8]
 304938     subcc   %i2, 0, %g0
 30493c     bgt     3048dc 
 304940     add     %i1, %o4, %i1
 304944     subcc   %i3, 0, %g0
 304948     bne     304950  annuled
 30494c     st      %i2, [%i3]
 304950     or      %g0, 0, %i0
 304954     jmp     %i7, 8, %g0
 304958     restore %g0, %g0, %g0
 <#0> ok 

 This also happens with a kernel which has not been touched by
 mdsetimage (i.e. the plain INSTALL image).

 (Hmm, might look like the kernel symbol table is overrunning the
 default boot code, which I think gets loaded at 0x300000, and the
 kernel loads at 0x4000, so....  Ouch!)


 Regards,

 - Havard

From: Havard.Eidnes@runit.sintef.no
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: Re: port-sparc/10059: synetbsd-INSTALL.gz fails with "panic: kernel fault"
Date: Sun, 07 May 2000 20:36:54 +0200

 Still more info:

 after generating a new boot.net based on boot.700000, the boot
 proceeds as it should, and I get no crash/panic.

 Thus, it would seem that this isn't a UVM problem per se, but
 rather the boot code interfering with the kernel, either through
 the symbol table (as in my last and tangential case), or in some
 other way with the kernel.

 Regards,

 - H=E5vard
State-Changed-From-To: open->closed 
State-Changed-By: pk 
State-Changed-When: Sun Jul 9 15:36:47 PDT 2000 
State-Changed-Why:  
Bootblock link address moved up to 0x3E0000 to avoid overwriting 
with kernel image (back-ported to 1.4.3). 
>Unformatted:
 >> NetBSD/sparc Secondary Boot, Revision 1.8
 >> (toddpw@threepio.toddpw.net, Fri Mar  3 17:51:31 PST 2000)
 boot: client IP address: 129.241.249.77
 boot: client name: anker.runit.no
 root addr=129.241.249.70 path=/var/tmp
 Booting netbsd @ 0x4000
 1056768+1738008+146404+[62268+71473]=0x2f2b71
 OBP version 3, revision 2.5 (plugin rev 2)
 [ preserving 133748 bytes of netbsd a.out symbol table ]
 console is ttya
 Copyright (c) 1996, 1997, 1998, 1999, 2000
     The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

 data fault: pc=0xf00b8f9c addr=0x0 sfsr=1a6<PERR=0,LVL=1,AT=5,FT=1,FAV,OW>
 panic: kernel fault
 Stopped in  at  _Debugger+0x4:  jmpl            [%o7 + 0x8], %g0
 db> trace
 _mem_access_fault4m(0x0, 0x1a6, 0x0, 0xf010dcd0, 0xf0396874, 0xf0002000) at _me
 m_access_fault4m+0x308
 memfault_sun4m(0x0, 0x0, 0xf02cfa74, 0x7a51, 0xf02cf800, 0xffffffff) at memfaul
 t_sun4m+0xe4
 _uvm_map(0xf051e000, 0x6ac000, 0x0, 0x0, 0x0, 0x0) at _uvm_map+0x478
 _uvm_km_alloc1(0xf02aeed8, 0x6ac000, 0x1, 0x0, 0x0, 0xf00f44e8) at _uvm_km_allo
 c1+0xf4
 _kmeminit(0xf06ac000, 0xfe000000, 0xf02c9fe0, 0x1, 0xf06ab874, 0xf02c9fa8) at _
 kmeminit+0x10
 _uvm_init(0xf0110400, 0x1, 0xf0002000, 0xf010df20, 0xf010df18, 0x8) at _uvm_ini
 t+0x68
 _main(0x0, 0xf02c8e70, 0xf00021b8, 0xf010e0a3, 0xffef201c, 0x0) at _main+0x34
 startmap_done(0x1, 0x30c800, 0x301ee0, 0x0, 0x0, 0x8) at startmap_done+0x1cc
 db>

 	If my ability to disassemble "-g"-compiled .o files is up to
 	par, it would seem that this is happening near the end of
 	uvm_map():

 (gdb) i li 689
 Line 689 of "../../../../uvm/uvm_map.c" starts at address 0xc08 <uvm_map+1136>
    and ends at 0xc18 <uvm_map+1152>.
 (gdb) x/i 0xc08
 0xc08 <uvm_map+1136>:   mov  %l3, %o0
 (gdb) x/i
 0xc0c <uvm_map+1140>:   mov  6, %o1
 (gdb) 
 0xc10 <uvm_map+1144>:   call  0xc10 <uvm_map+1144>
 (gdb) 
 0xc14 <uvm_map+1148>:   clr  %o2
 (gdb) 
 0xc18 <uvm_map+1152>:   clr  %i0
 (gdb) l 689
 684             if ((map->first_free == prev_entry) &&
 685                 (prev_entry->end >= new_entry->start))
 686                     map->first_free = new_entry;
 687     
 688             UVMHIST_LOG(maphist,"<- done!", 0, 0, 0, 0);
 689             vm_map_unlock(map);
 690             return(KERN_SUCCESS);
 691     }
 692     
 693     /*
 (gdb) 

 	and 1144 == 0x478 (see traceback above)

 	/sys/vm/vm_map.h defines vm_map_unlock as:

 #define vm_map_unlock(map) \
                 lockmgr(&(map)->lock, LK_RELEASE, (void *)0)

 	It *does* however sound a little nuts that it should fault on
 	a call instruction, and the preceding ones also look
 	"innocent" enough to me...

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.