From owner-freebsd-sparc64@FreeBSD.ORG Tue Dec 21 02:50:26 2004 Return-Path: Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F3E2D16A4CE for ; Tue, 21 Dec 2004 02:50:25 +0000 (GMT) Received: from ns.kt-is.co.kr (ns.kt-is.co.kr [211.218.149.125]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72F2443D39 for ; Tue, 21 Dec 2004 02:50:25 +0000 (GMT) (envelope-from yongari@kt-is.co.kr) Received: from michelle.kt-is.co.kr (ns2.kt-is.co.kr [220.76.118.193]) (authenticated bits=128) by ns.kt-is.co.kr (8.12.10/8.12.10) with ESMTP id iBL2iVAh092514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 21 Dec 2004 11:44:31 +0900 (KST) Received: from michelle.kt-is.co.kr (localhost.kt-is.co.kr [127.0.0.1]) by michelle.kt-is.co.kr (8.13.1/8.13.1) with ESMTP id iBL2oOMh004721 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Dec 2004 11:50:24 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Received: (from yongari@localhost) by michelle.kt-is.co.kr (8.13.1/8.13.1/Submit) id iBL2oN54004720; Tue, 21 Dec 2004 11:50:23 +0900 (KST) (envelope-from yongari@kt-is.co.kr) Date: Tue, 21 Dec 2004 11:50:23 +0900 From: Pyun YongHyeon To: "R. Tyler Ballance" Message-ID: <20041221025023.GB4468@kt-is.co.kr> References: <1103596207.2542.35.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1103596207.2542.35.camel@localhost.localdomain> User-Agent: Mutt/1.4.2.1i X-Filter-Version: 1.11a (ns.kt-is.co.kr) cc: freebsd-sparc64@freebsd.org Subject: Re: sysinstall dead in -CURRENT? X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: yongari@kt-is.co.kr List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Dec 2004 02:50:26 -0000 On Mon, Dec 20, 2004 at 08:30:07PM -0600, R. Tyler Ballance wrote: > Ok, I'm not sure if this is because of Marius' patch for zs(4) on my > Ultra 2 or not (probably not since I'm using SSH) > > Anyways, i'm starting up sysinstall to install some packages, and this > is what I get. > > -----[snip]------ > x Probing devices, please wait (this can take a > while)...Floating exception (core dumped) > -------------------------------------------------- > ares# > > -----[snip]------ > > And then back out to the prompt. Ouch > > Any ideas? > AFAIK, this has nothing to do with marius' zs(4) patch. There is also PR72962 for the issue. Long ago, I made a patch for this issue. But it wasn't further investigated due to lack of time. I sent a mail to one of developer but got no reply. The following is the summary of the mail. It seems that it happans on on systems with SCSI CDROM. In rev. 1.90 of scsi_cd.c, phk changed to return 2k sectors when no media inserted. But open_disk.c:Int_Open_Disk() just check sectorsize against 0. So if we have no media in CDROM, we would bypass the check and could generate division by zero exception. I guess we need at least the following patch. It seems that there are two cases here. 1. No media in CDROM -> sector = 2k, hd = 0 2. media present in CDROM -> sector = 0, hd = 0 --- open_disk.c.orig Mon Sep 20 11:22:10 2004 +++ open_disk.c Tue Oct 26 17:45:17 2004 @@ -94,6 +94,8 @@ return (NULL); d->sector_size = s; len /= s; /* media size in number of sectors. */ + if (len == 0) + return (NULL); if (Add_Chunk(d, 0, len, name, whole, 0, 0, "-")) { DPRINT(("Failed to add 'whole' chunk")); @@ -123,6 +125,10 @@ */ o = d->bios_hd * d->bios_sect; d->bios_cyl = (o != 0) ? len / o : 0; + if (d->bios_cyl == 0) { + /* XXX This may indicate it is not DISK. */ + return (NULL); + } p = q; lo[0] = 0; And another one to plug memory leak. --- disk.c.orig Mon May 17 07:08:16 2004 +++ disk.c Tue Oct 26 16:46:23 2004 @@ -77,6 +77,7 @@ struct disk * Open_Disk(const char *name) { + struct disk *d; char *conftxt; size_t txtsize; int error; @@ -99,7 +100,10 @@ } conftxt[txtsize] = '\0'; /* in case kernel bug is still there */ - return Int_Open_Disk(name, conftxt); + d = Int_Open_Disk(name, conftxt); + free(conftxt); + + return (d); } void BTW, I don't know why GEOM thinks SCSI CDROM as a disk. On systems with IDE CDROM, it is not considered as a disk. So above problem only happen on systems with SCSI CDROM. With above patches my U2 displayed install screen successfully with/without CD mdia in CDROM. Hope this help. > -R. Tyler Ballance -- Regards, Pyun YongHyeon http://www.kr.freebsd.org/~yongari | yongari@freebsd.org