From owner-freebsd-current@FreeBSD.ORG Sun Dec 3 17:21:06 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C295116A50B; Sun, 3 Dec 2006 17:21:06 +0000 (UTC) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (eva.fit.vutbr.cz [147.229.176.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 716E643D4C; Sun, 3 Dec 2006 17:20:21 +0000 (GMT) (envelope-from xdivac02@stud.fit.vutbr.cz) Received: from eva.fit.vutbr.cz (localhost [127.0.0.1]) by eva.fit.vutbr.cz (envelope-from xdivac02@eva.fit.vutbr.cz) (8.13.8/8.13.7) with ESMTP id kB3HKe1a057993 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 3 Dec 2006 18:20:40 +0100 (CET) Received: (from xdivac02@localhost) by eva.fit.vutbr.cz (8.13.8/8.13.3/Submit) id kB3HKeeQ057992; Sun, 3 Dec 2006 18:20:40 +0100 (CET) Date: Sun, 3 Dec 2006 18:20:40 +0100 From: Divacky Roman To: Boris Samorodov Message-ID: <20061203172040.GA51391@stud.fit.vutbr.cz> References: <20061202160740.55046cc3@Magellan.Leidinger.net> <68623948@bsam.ru> <15016603_-_@bsam.ru> <20061203101418.GA20731@stud.fit.vutbr.cz> <91817778@bsam.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <91817778@bsam.ru> User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.57 on 147.229.176.14 Cc: amd64@freebsd.org, Alexander Leidinger , current@freebsd.org Subject: Re: [panic] Re: small heads-up: Syncing amd64 GENERIC with i386 GENERIC (removing LINUX stuff) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Dec 2006 17:21:07 -0000 On Sun, Dec 03, 2006 at 05:06:37PM +0300, Boris Samorodov wrote: > On Sun, 3 Dec 2006 11:14:18 +0100 Divacky Roman wrote: > > On Sun, Dec 03, 2006 at 02:18:28AM +0300, Boris Samorodov wrote: > > > On Sat, 02 Dec 2006 22:40:51 +0300 Boris Samorodov wrote: > > > > On Sat, 2 Dec 2006 16:07:40 +0100 Alexander Leidinger wrote: > > > > > > > > the linux module is now usable on amd64 (thanks to kib@ and his commit > > > > > to the kernel linker in HEAD). > > > > > > > Cvsupped a couple of hours ago my amd64-current, rebuilt/reinstalled > > > > world/kernel. The kernel is GENERIC without COMPAT_LINUX32, LINPROCFS, > > > > LINSYSFS. But linux.ko hadn't been built. Should I cvsup once more or > > > > did I miss something? > > > > > > > I'd tested kib@ patches (about two weeks ago) and noticed that linux > > > > kernel module can't be unloaded _after_ mounting/unmounting linprocfs, > > > > linsysfs or linux devfs. Can anybody confirm? > > > > > > OK, after cvsup and rebuild/install kernel I do: > > > > > > # kldload linux > > > # kldload linsysfs > > > # kldunload linsysfs > > > > > > and get a reprodusable panic: > > > 1) if you have linux "module" built statically in kernel can you reproduce > > this panic by kldload linsysfs && kldunload linsysfs? > > The same panic. so its not related to the recent commit and modulification of linux@amd64 I looked at the code from the bt and its like this: TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) { TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next); free(scsi_host->path, M_TEMP); free(scsi_host, M_TEMP); } I see two possible problems... 1) the TAILQ_FOREACH is used when we remove the entry.. _SAFE variant should be used imho 2) there is no locking can someone confirm me? if my analysis is correct - is changing it to _SAFE + possible some locking enough? roman p.s. boris... can you try this patch: Index: linsysfs.c =================================================================== RCS file: /home/ncvs/src/sys/compat/linsysfs/linsysfs.c,v retrieving revision 1.2 diff -u -r1.2 linsysfs.c --- linsysfs.c 11 May 2006 15:27:58 -0000 1.2 +++ linsysfs.c 3 Dec 2006 17:20:14 -0000 @@ -268,9 +268,9 @@ static int linsysfs_uninit(PFS_INIT_ARGS) { - struct scsi_host_queue *scsi_host; + struct scsi_host_queue *scsi_host, *scsi_host_tmp; - TAILQ_FOREACH(scsi_host, &scsi_host_q, scsi_host_next) { + TAILQ_FOREACH_SAFE(scsi_host, &scsi_host_q, scsi_host_next, scsi_host_tmp) { TAILQ_REMOVE(&scsi_host_q, scsi_host, scsi_host_next); free(scsi_host->path, M_TEMP); free(scsi_host, M_TEMP);