From owner-freebsd-sparc64@FreeBSD.ORG Thu Oct 21 12:40:28 2004 Return-Path: Delivered-To: freebsd-sparc64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D280A16A4CE for ; Thu, 21 Oct 2004 12:40:28 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA51C43D5A for ; Thu, 21 Oct 2004 12:40:28 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i9LCeShG044718 for ; Thu, 21 Oct 2004 12:40:28 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i9LCeSOJ044717; Thu, 21 Oct 2004 12:40:28 GMT (envelope-from gnats) Resent-Date: Thu, 21 Oct 2004 12:40:28 GMT Resent-Message-Id: <200410211240.i9LCeSOJ044717@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-sparc64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Andrew Belashov Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 968E816A4CE for ; Thu, 21 Oct 2004 12:37:04 +0000 (GMT) Received: from white.orel.ru (white.orel.ru [213.59.64.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE14543D4C for ; Thu, 21 Oct 2004 12:37:03 +0000 (GMT) (envelope-from bel@white.orel.ru) Received: from white.orel.ru (localhost [127.0.0.1]) by white.orel.ru (8.12.9/8.12.9) with ESMTP id i9LCb0fT076486 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 21 Oct 2004 16:37:01 +0400 (MSD) (envelope-from bel@white.orel.ru) Received: (from bel@localhost) by white.orel.ru (8.12.9/8.12.9/Submit) id i9LCax5Z076485; Thu, 21 Oct 2004 16:36:59 +0400 (MSD) Message-Id: <200410211236.i9LCax5Z076485@white.orel.ru> Date: Thu, 21 Oct 2004 16:36:59 +0400 (MSD) From: Andrew Belashov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: sparc64/72962: [sysinstall] Sysinstall panics on sparc64 if /dev/cd0 present X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Andrew Belashov List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Oct 2004 12:40:29 -0000 >Number: 72962 >Category: sparc64 >Synopsis: [sysinstall] Sysinstall panics on sparc64 if /dev/cd0 present >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-sparc64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 21 12:40:28 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Andrew Belashov >Release: FreeBSD 5.3-BETA7 sparc64 >Organization: JSC CenterTelecom >Environment: System: FreeBSD bel.localdomain 5.3-BETA7 FreeBSD 5.3-BETA7 #11: Thu Oct 14 13:02:53 MSD 2004 bel@bel.localdomain:/usr/obj/usr/src/sys/SUNC3D sparc64 $ dmesg|grep cd cd0 at sym0 bus 0 target 6 lun 0 cd0: Removable CD-ROM SCSI-2 device cd0: 20.000MB/s transfers (20.000MHz, offset 16) cd0: Attempt to query device size failed: NOT READY, Medium not present >Description: On sparc64 systems sysinstall panics after "Probing devices, please wait (this can take a while)...": Floating point exception (core dumped) >How-To-Repeat: # gdb53 /usr/obj/usr/src/usr.sbin/sysinstall/sysinstall GNU gdb 5.3 (FreeBSD) [...] This GDB was configured as "sparc64-portbld-freebsd5.2"... (gdb) run Program received signal SIGFPE, Arithmetic exception. 0x00000000001241f4 in Int_Open_Disk (name=0x2a4350 "cd0", conftxt=0x276a1c "0") at /usr/src/lib/libdisk/open_disk.c:270 270 o = d->chunks->size / (hd * sc); (gdb) l 265 /* PLATFORM POLICY BEGIN ------------------------------------- */ 266 /* We have a chance to do things on a blank disk here */ 267 if (platform == p_sparc64 && d->chunks->part->part == NULL) { 268 hd = d->bios_hd; 269 sc = d->bios_sect; 270 o = d->chunks->size / (hd * sc); 271 o *= (hd * sc); 272 o -= 2 * hd * sc; 273 if (Add_Chunk(d, 0, o, name, freebsd, 0, 0, "-")) { 274 DPRINT(("Failed to add 'freebsd' chunk")); (gdb) p hd $1 = 0 (gdb) p sc $2 = 0 (gdb) p d[0] $3 = {name = 0x2a4360 "cd0", bios_cyl = 0, bios_hd = 0, bios_sect = 0, bootmgr = 0x0, bootmgr_size = 0, boot1 = 0x0, chunks = 0x29c200, sector_size = 512} >Fix: It is necessary to fix libdisk(3). --- libdisk.patch begins here --- --- lib/libdisk/open_disk.c.orig Tue Oct 12 16:02:58 2004 +++ lib/libdisk/open_disk.c Thu Oct 21 16:19:40 2004 @@ -267,6 +267,8 @@ Int_Open_Disk(const char *name, char *co if (platform == p_sparc64 && d->chunks->part->part == NULL) { hd = d->bios_hd; sc = d->bios_sect; + if ((hd * sc) == 0) + return (NULL); o = d->chunks->size / (hd * sc); o *= (hd * sc); o -= 2 * hd * sc; --- libdisk.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: