From owner-freebsd-bugs@FreeBSD.ORG Mon May 31 14:00:48 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BEAA016A4CE for ; Mon, 31 May 2004 14:00:48 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BB0743D49 for ; Mon, 31 May 2004 14:00:48 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i4VL0k7W054908 for ; Mon, 31 May 2004 14:00:46 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4VL0kl8054907; Mon, 31 May 2004 14:00:46 -0700 (PDT) (envelope-from gnats) Resent-Date: Mon, 31 May 2004 14:00:46 -0700 (PDT) Resent-Message-Id: <200405312100.i4VL0kl8054907@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Matthew Emmerton Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0484C16A4CE for ; Mon, 31 May 2004 13:50:37 -0700 (PDT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id F25A143D2D for ; Mon, 31 May 2004 13:50:36 -0700 (PDT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.12.11/8.12.11) with ESMTP id i4VKoU1M076085 for ; Mon, 31 May 2004 13:50:30 -0700 (PDT) (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.12.11/8.12.11/Submit) id i4VKoUZC076074; Mon, 31 May 2004 13:50:30 -0700 (PDT) (envelope-from nobody) Message-Id: <200405312050.i4VKoUZC076074@www.freebsd.org> Date: Mon, 31 May 2004 13:50:30 -0700 (PDT) From: Matthew Emmerton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/67426: kldunload snd causes machine to trap X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2004 21:00:48 -0000 >Number: 67426 >Category: kern >Synopsis: kldunload snd causes machine to trap >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 31 14:00:46 PDT 2004 >Closed-Date: >Last-Modified: >Originator: Matthew Emmerton >Release: 4.10-STABLE >Organization: GSI Computer Service >Environment: FreeBSD penelope.gsicomp.on.ca 4.10-STABLE FreeBSD 4.10-STABLE #4: Sun May 30 16:46:28 EDT 2004 root@penelope.gsicomp.on.ca:/usr/obj/usr/src/sys/PENELOPE.20040505.01 i386 >Description: Doing a 'kldunload snd' causes the machine to panic (kernel trap 12). This has been discussed on various mailing lists, and the "workaround" is to add "device pcm" in the kernel config. This avoids the problem since the system no longer uses the 'pcm' module. The *real* problem is that the 'sbc' module does not properly identify its dependency on the 'pcm' module, and therefore, when kldunloading the 'snd' mega-module, 'pcm' may be unloaded before 'sbc' and will cause the trap. This was found (and fixed) in DragonFlyBSD 4 months ago. http://www.shiningsilence.com/mailarchive/bugs/2004-January/0403.html >How-To-Repeat: On a machine *without* "device pcm" in the kernel, do the following: # kldload snd # kldunload snd < kernel panic > >Fix: Against -stable (codebase I'm using): --- sys/modules/sound/driver/sbc/Makefile.orig Sun May 30 19:25:46 2004 +++ sys/modules/sound/driver/sbc/Makefile Sun May 30 19:25:39 2004 @@ -4,5 +4,6 @@ KMOD = snd_sbc SRCS = device_if.h bus_if.h isa_if.h pci_if.h SRCS += sbc.c +KMODDEPS = snd_pcm .include >Release-Note: >Audit-Trail: >Unformatted: