From owner-freebsd-scsi Thu Apr 24 02:31:00 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id CAA26765 for freebsd-scsi-outgoing; Thu, 24 Apr 1997 02:31:00 -0700 (PDT) Received: from hda.hda.com (hda-bicnet.bicnet.net [207.198.1.121]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id CAA26755 for ; Thu, 24 Apr 1997 02:30:54 -0700 (PDT) Received: (from dufault@localhost) by hda.hda.com (8.8.5/8.8.5) id FAA02943; Thu, 24 Apr 1997 05:17:48 -0400 (EDT) From: Peter Dufault Message-Id: <199704240917.FAA02943@hda.hda.com> Subject: Re: Panic in sys/scsi/scsiconf.c - Please Help... In-Reply-To: from Simon Shapiro at "Apr 23, 97 10:25:18 pm" To: Shimon@i-Connect.Net (Simon Shapiro) Date: Thu, 24 Apr 1997 05:17:48 -0400 (EDT) Cc: scsi@freebsd.org X-Mailer: ELM [version 2.4ME+ PL25 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-scsi@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I am calling scsi_attachdevs() from a device driver and getting PANIC: > > extend_set: entry 1 already has storage > panic: scsi-attachdevs: malloc. > > Upon close examination one sees the lines: > > if(scbus == 0 || scbus->sc_link == 0 > || extend_set(scbusses, scsibus, scbus) == 0) { > panic("scsi_attachdevs: malloc"); > ... > (That first "scbus == 0" isn't doing anything since it was just dereferenced.) Extend_set is allocating pointers in chunks, and reallocating and moving them when it runs out of point space. Then the array can be indexed at run time instead of walking a data structure. extend_set is panicing because it requires: 1. That the index (scsibus) not have already been set; 2. That newly allocated storage be zeroed. We're probably violating rule 1. I'm surprised you're on your 176th disk and just now getting to bus 1. Is there a chance you have two devices wired down to bus 1 and nothing complained? Try boot verbose, and next time include your config output. > us->sc_link == 0 > || extend_set(scbusses, scsibus, scbus) == 0) { > panic("scsi_attachdevs: malloc"); And as Justin asked, why do you always get repeated text at the end of your messages? Peter -- Peter Dufault (dufault@hda.com) Realtime Machine Control and Simulation HD Associates, Inc. Voice: 508 433 6936