Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2004 13:50:30 -0700 (PDT)
From:      Matthew Emmerton <matt@gsicomp.on.ca>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/67426: kldunload snd causes machine to trap
Message-ID:  <200405312050.i4VKoUZC076074@www.freebsd.org>
Resent-Message-ID: <200405312100.i4VL0kl8054907@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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 <bsd.kmod.mk>

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405312050.i4VKoUZC076074>