From owner-freebsd-bugs Fri Sep 29 22:50: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6902537B503 for ; Fri, 29 Sep 2000 22:50:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA15182; Fri, 29 Sep 2000 22:50:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: by hub.freebsd.org (Postfix, from userid 32767) id 23B7137B503; Fri, 29 Sep 2000 22:41:54 -0700 (PDT) Message-Id: <20000930054154.23B7137B503@hub.freebsd.org> Date: Fri, 29 Sep 2000 22:41:54 -0700 (PDT) From: mzaki@e-mail.ne.jp To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: i386/21657: nexus without initialization causes booting failed Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21657 >Category: i386 >Synopsis: nexus without initialization causes booting failed >Confidential: no >Severity: critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Sep 29 22:50:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Motomichi Matsuzaki >Release: FreeBSD-current (Sep 29 2000) >Organization: >Environment: FreeBSD localhost 5.0-CURRENT FreeBSD 5.0-CURRENT #7: Sat Sep 30 14:01:29 JST 2000 root@localhost:/usr/src/sys/compile/LIBRETTO i386 >Description: I've updated my laptop (TOSHIBA Libretto) to -current (21:00 29 Sep GMT) from of 28 Aug, then it wouldn't boot because trap 12 happened. The boottime messages were shown that: : : npx0: INT 16 interface isa0: ^ normally is succeeded "on motherboard" but isn't And the trap 12 (page fault) occured at: (sys/i386/i386/nexus.c) static int nexus_print_all_resources(device_t dev) { struct nexus_device *ndev = DEVTONX(dev); struct resource_list *rl = &ndev->nx_resources; ~~~~~~~ This dereference (ndev was NULL!!) This 'struct nexus_device *ndev' is IVAR of nexus, and initialized in nexus_add_child(), but never called this function in my laptop. >How-To-Repeat: >Fix: In nexus_attach(), ISA bus directly binded to nexus is connected via calling device_add_child(), but this is probably WRONG. This causes uninitialized IVAR of nexus because of skipping nexus_add_child(). I changed this to calling nexus_add_child() directly, and my laptop successfully booted. --- /usr/src/sys/i386/i386/nexus.c Fri Sep 29 06:02:31 2000 +++ nexus.c Sat Sep 30 14:41:11 2000 @@ -259,7 +259,7 @@ } #endif if (!devclass_get_device(devclass_find("isa"), 0)) { - child = device_add_child(dev, "isa", 0); + child = nexus_add_child(dev, 0, "isa", 0); if (child == NULL) panic("nexus_attach isa"); device_probe_and_attach(child); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message