Subject: Re: port-i386/7608: i386 1.4 sysinst upgrade fall down go BOOM!
To: None <netbsd-bugs@netbsd.org>
From: Chris G. Demetriou <cgd@netbsd.org>
List: netbsd-bugs
Date: 06/18/1999 01:06:24
cgd@netbsd.org writes:
> 	sysinst blew up (Floating Point Exception, core dump) after
> 	installing the installation binaries on the hard disk and running
> 	installboot.  I ran sysinst with logging and scripting turned
> 	on, and the last thing in the script was:

I investigated this some more.

The problem is trivially reproducable (if you have a disk to nuke 8-):

	* boot the 1.3.2 install floppy, install NetBSD.
	  standard + x, whole disk.  have it clobber the disk.
	  when it gets to the point of trying to install sets,
	  reboot.

	* boot the 1.4 install floppy, upgrade.  follow the prompts,
	  boom.

I dug into the problem some more, and found that when writing the
upgraded MBR, convert_mbr_chs() was called with cyl == head == sec ==
0.  Since these arguments' values come from globals which are
initialized when the BIOS geometry is figured in md_bios_info(), it
would seem that md_bios_info() should be being called but isn't.

Unfortunately, I'm not really familiar enough with the way this should
work to know where it should be called.  (However, this doesn't sound
like a configuration-specific bug...  was the upgrade code _ever_
tested by the people hacking on it?!)


Things which I noticed which also caused me concern:

in md_upgrade_mbrtype(), read_mbr() is called.  If an error occurs
md_upgrade_mbrtype gives up (but doesn't signal an error -- should it
be able to?  probably it should be _able_ to, if not for this case
then for the case where write_mbr fails).  However, if no error occurs
bu the MBR is not actually valid, it continues merrily along.  It's
not clear to me that this is 'right'.

in md_get_info(), the return value from read_mbr() is ignored
completely, but valid_mbr() is checked...  This seems like it might be
OK, but consistency and carefulness are better than the lack
thereof...




cgd
-- 
Chris Demetriou - cgd@netbsd.org - http://www.netbsd.org/People/Pages/cgd.html
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.