NetBSD Problem Report #49202

From gson@gson.org  Sun Sep 14 13:35:47 2014
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5DFA0CDBBE
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 14 Sep 2014 13:35:47 +0000 (UTC)
Message-Id: <20140914133534.0C7F075E30@guava.gson.org>
Date: Sun, 14 Sep 2014 16:35:34 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@gnats.NetBSD.org
Subject: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
X-Send-Pr-Version: 3.95

>Number:         49202
>Category:       port-sparc
>Synopsis:       6.1.4 GENERIC kernel does not boot on SPARCstation IPX
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 14 13:40:00 +0000 2014
>Last-Modified:  Thu Sep 18 06:55:01 +0000 2014
>Originator:     Andreas Gustafsson
>Release:        NetBSD 6.1.4
>Organization:
>Environment:
System: NetBSD
Architecture: sparc
Machine: sparc
>Description:

I have a SPARCstation IPX with 40 MB RAM and a working installation of
NetBSD 3.0.  I tried booting a GENERIC kernel from the NetBSD/sparc
6.1.4 release on it (using the existing bootloader), but it didn't
boot:

  Boot device: /sbus/esp@0,800000/sd@3,0:a   File and args: 
  >> NetBSD/sparc Secondary Boot, Revision 1.15
  >> (builds@b3.netbsd.org, Mon Dec 19 03:43:03 UTC 2005)
  Booting netbsd
  read header
  Cannot load netbsd: error=27

Code 27 is EFBIG, and a custom kernel with a few file systems and
device drivers omitted does boot, so this looks like the 4 MB limit
discussed in

  http://mail-index.netbsd.org/port-sparc/2005/05/05/0000.html

Presumably this problem will also affect anyone attempting to do a
new installation of 6.1.4 on an IPX.

>How-To-Repeat:

Attempt to boot the NetBSD/sparc 6.1.4 GENERIC kernel on a
SPARCstation IPX.

>Fix:

Slim down the GENERIC kernel a bit?

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Sun, 14 Sep 2014 19:04:24 +0200

 Can you show the physical memory configuration from the PROM?

 Martin

From: Andreas Gustafsson <gson@gson.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org,
    port-sparc-maintainer@netbsd.org
Subject: Re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Sun, 14 Sep 2014 21:30:20 +0300

 Martin Husemann wrote:
 >  Can you show the physical memory configuration from the PROM?

 What's the command to do that?
 -- 
 Andreas Gustafsson, gson@gson.org

From: Martin Husemann <martin@duskware.de>
To: Andreas Gustafsson <gson@gson.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 09:59:02 +0200

 On Sun, Sep 14, 2014 at 09:30:20PM +0300, Andreas Gustafsson wrote:
 > Martin Husemann wrote:
 > >  Can you show the physical memory configuration from the PROM?
 > 
 > What's the command to do that?


 Not sure, something like:

  cd /memory
  .attributes

 Martin

From: Andreas Gustafsson <gson@gson.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 11:26:16 +0300

 Martin Husemann wrote:
 >  cd /memory
 >  .attributes

   ok cd /memory
   ok .attributes
   reg                      00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
   available                00 00 00 00 03 fc 60 00 00 03 a0 00 00 00 00 00 
   name                     memory
   ok banner
   SPARCstation IPX, No Keyboard
   ROM Rev. 2.4, 40 MB memory installed, Serial #8287715.
   Ethernet address 8:0:20:89:b3:b0, Host ID: 577e75e3.

 Regards,
 -- 
 Andreas Gustafsson, gson@gson.org

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: port-sparc-maintainer@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org, gson@gson.org (Andreas Gustafsson)
Subject: re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 18:54:40 +1000

 >    ROM Rev. 2.4, 40 MB memory installed, Serial #8287715.

 hmm, so 4+4+16+16?  i bet one of the 4MB parts is first...

 this page gives an order for installation.  can you check
 if your 16MB is in U0310/slot0?

 http://docs.oracle.com/cd/E19957-01/800-5774-10/fsm.chapter4.html

 Install SIMMs in the following order: 
 	Slot 0 (U0310)
 	Slot 2 (U0308)
 	Slot 1 (U0309)
 	Slot 3 (U0307)

 someone could parse the /memory output but not me right now ;)

From: Andreas Gustafsson <gson@gson.org>
To: matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@NetBSD.org,
    port-sparc-maintainer@netbsd.org
Subject: re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 15:31:44 +0300

 matthew green wrote:
 > >    ROM Rev. 2.4, 40 MB memory installed, Serial #8287715.
 > 
 > hmm, so 4+4+16+16?  i bet one of the 4MB parts is first...

 I checked, and the SIMM in U0310 was a 16 MB one.

 I have now changed all four SIMMs to 16 MB ones from another IPX, and
 I'm still getting the same error:

    ok boot disk netbsd
    Can't open input device.
    SPARCstation IPX, No Keyboard
    ROM Rev. 2.4, 64 MB memory installed, Serial #8287715.
    Ethernet address 8:0:20:89:b3:b0, Host ID: 577e75e3.


    Rebooting with command: disk netbsd
    Boot device: /sbus/esp@0,800000/sd@3,0   File and args: netbsd
    >> NetBSD/sparc Secondary Boot, Revision 1.15
    >> (builds@b3.netbsd.org, Mon Dec 19 03:43:03 UTC 2005)
    Booting netbsd
    read header
    Cannot load netbsd: error=27

    device[/sbus/esp@0,800000/sd@3,0] ("halt" to halt): halt
    Program terminated
    Type  help  for more information
    ok cd /memory
    ok .attributes
    reg                      00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 
    available                00 00 00 00 03 fc 60 00 00 03 a0 00 00 00 00 00 
    name                     memory

 And as before, a custom kernel built from 6.1.4 sources with a few
 file systems and drivers omitted does boot.

 Regards,
 -- 
 Andreas Gustafsson, gson@gson.org

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org
Cc: matthew green <mrg@eterna.com.au>,
    Martin Husemann <martin@duskware.de>,
    port-sparc-maintainer@netbsd.org
Subject: re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 16:37:26 +0300

 Some more observertions...

 The message "read header" appears before "Cannot load netbsd: error=27"
 in the unsuccessful boots, but does not appear in successful boots.

 The string "read header" appears in fdloadfile() in old versions of
 src/sys/lib/libsa/loadfile.c (in the current version, it has been
 split into two separate messages, "read header failed" and "read header
 short").

 So, it looks like the read() call to read the ELF header is returning
 EFBIG.

 One place where this EFBIG could originate from is block_map()
 in src/sys/lib/libsa/ufs.c, after the comment /* Block number too high */.

 This lead me to look at the block numbers of the kernel files using
 fsdb.  It turns out the kernels that boot successfully all have small
 block numbers, and the one that doesn't has much larger block numbers.
 Here's what the fsdb "blks" command has to say about my successfully
 booting custom kernel:

   fsdb (inum: 397513)> inode 6
   current inode: regular file
   I=6 MODE=100755 SIZE=4421888
 	  MTIME=Sep 13 21:12:11 2014 [200000000 nsec]
 	  CTIME=Sep 13 23:54:39 2014 [476824999 nsec]
 	  ATIME=Sep 17 16:40:22 2014 [122303999 nsec]
   OWNER=root GRP=wheel LINKCNT=1 FLAGS=0x0 BLKCNT=0x21d0 GEN=0x4
   fsdb (inum: 6)> blks
   I=6 8656 blocks
   Direct blocks:
   0: 1280 1288 1296 1304 1312 1320 1328 1336 1344 1352 1360 1368 
   Indirect block 1376 (level 1):
   12: 1384 1392 1400 1408 1416 1424 1432 1440 1448 1456 1464 1472 1480 1488 
   26: 1496 1504 1512 1520 1528 1536 1544 1552 1560 1568 1576 1584 1592 1600 
   40: 1608 1616 1624 1632 1640 1648 1656 1664 1672 1680 1688 1696 1704 1712 
   54: 1720 1728 1736 1744 1752 1760 1768 1776 1784 1792 1800 1808 1816 1824 
   68: 1832 1840 1848 1856 1864 1872 1880 1888 1896 1904 1912 1920 1928 1936 
   82: 1944 1952 1960 1968 1976 1984 1992 2000 2008 2016 2024 2032 2040 2048 

 And the non-booting GENERIC kernel:

   fsdb (inum: 2)> inode 397513 
   current inode: regular file
   I=397513 MODE=100755 SIZE=4650072
 	  MTIME=Apr 13 11:14:45 2014 [0 nsec]
 	  CTIME=Sep 17 12:56:57 2014 [860000000 nsec]
 	  ATIME=Sep 17 16:26:46 2014 [560868999 nsec]
   OWNER=root GRP=wheel LINKCNT=1 FLAGS=0x0 BLKCNT=0x22f0 GEN=0xc
   fsdb (inum: 397513)> blks
   I=397513 8944 blocks
   Direct blocks:
   0: 1780000 1780008 1780016 1780024 1780136 1780144 1780152 1780160 
   8: 1780168 1780176 1780184 1780192 
   Indirect block 1780200 (level 1):
   12: 1780208 1780216 1780224 1780232 1780240 1780248 1780256 1780264 
   20: 1780272 1780280 1780288 1780296 1780304 1780312 1780320 1780328 
   28: 1780336 1780344 1780352 1780360 1780368 1780376 1780384 1780392 
   36: 1780400 1780408 1780416 1780424 1780432 1780440 1780448 1780456 
   44: 1780464 1780472 1780480 1780488 1780496 1780504 1780512 1780520 

 So, next I tried overwriting my custom kernel by the GENERIC kernel
 using cp(1), resulting in a GENERIC kernel identical to the one that
 failed to boot, but residing at lower block numbers.  This kernel
 booted just fine.

 I guess the next step would be to update the bootloader to the 6.1.4
 one and see if it still has the same problem...
 -- 
 Andreas Gustafsson, gson@gson.org

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@NetBSD.org
Cc: matthew green <mrg@eterna.com.au>,
    Martin Husemann <martin@duskware.de>,
    port-sparc-maintainer@netbsd.org
Subject: re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Wed, 17 Sep 2014 22:56:14 +0300

 Earlier today, I said:
 > I guess the next step would be to update the bootloader to the 6.1.4
 > one and see if it still has the same problem...

 I tried to do that by installing the 6.1.4 userland and then running

   mv /boot /boot.old
   cp /usr/mdec/boot /boot
   installboot /dev/rsd0c /usr/mdec/bootxx /boot

 and now the machine no longer boots even the kernels that worked
 before.  The full console output from power-on is:

   WARNING: Unable to determine keyboard typeCan't open input device.
   SPARCstation IPX, No Keyboard
   ROM Rev. 2.4, 64 MB memory installed, Serial #8287715.
   Ethernet address 8:0:20:89:b3:b0, Host ID: 577e75e3.



   Testing   1 megs of memory. Still to go    0

   SBus slot 0 le esp dma 
   SBus slot 1 
   SBus slot 2 SUNW,pcmcia 
   SBus slot 3 cgsix 

   Boot device: /sbus/esp@0,800000/sd@3,0:a   File and args: 
   >> NetBSD/sparc Secondary Boot, Revision 1.15
   Booting netbsd
   Data Access Exception
   Type  help  for more information
   ok 

 Based on the "Data Access Exception" message and the ROM revision,
 it looks like I may also be be suffering from PR 37080.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-sparc/49202: 6.1.4 GENERIC kernel does not boot on SPARCstation IPX
Date: Thu, 18 Sep 2014 08:54:17 +0200

 On Wed, Sep 17, 2014 at 08:00:00PM +0000, Andreas Gustafsson wrote:
 >  Based on the "Data Access Exception" message and the ROM revision,
 >  it looks like I may also be be suffering from PR 37080.

 That is good, isn't it? As an expert in cvs bisection, you can now find
 out wich commit is the culprit.

 sys/arch/sparc/stand/bootxx/promlib.c and
 sys/arch/sparc/sparc/promlib.c go back to early 1999 with only ~50 commits
 in total, however it may not always be possible to warp back those files
 alone.

 Martin

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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.