From nobody@FreeBSD.org  Sun Jun  1 00:47:05 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 729BD1065670
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  1 Jun 2008 00:47:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B37E8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Sun,  1 Jun 2008 00:47:05 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m510jJ0U010499
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 1 Jun 2008 00:45:19 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m510jJtT010498;
	Sun, 1 Jun 2008 00:45:19 GMT
	(envelope-from nobody)
Message-Id: <200806010045.m510jJtT010498@www.freebsd.org>
Date: Sun, 1 Jun 2008 00:45:19 GMT
From: Jos Backus <jos@catnook.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Panic after installing audio/oss on an Asus A8N-SLI Premium mobo
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         124174
>Category:       kern
>Synopsis:       [panic] Panic after installing audio/oss on an Asus A8N-SLI Premium mobo
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jun 01 00:50:03 UTC 2008
>Closed-Date:    Fri Oct 05 08:25:55 UTC 2012
>Last-Modified:  Fri Oct 05 08:25:55 UTC 2012
>Originator:     Jos Backus
>Release:        -current
>Organization:
>Environment:
FreeBSD lizzy.catnook.local 8.0-CURRENT FreeBSD 8.0-CURRENT #4: Wed May 28 11:02:36 PDT 2008     root@lizzy.catnook.local:/usr/obj/usr/src/sys/LIZZY  i386

>Description:
In an attempt to use the Realtek ALC850 S/PDIF output on an Asus A8N-SLI
Premium mobo I installed the latest audio/oss port and enabled it in rc.conf.
Using mplayer to play an MP3 file on the text console seems to work fine but
when artsd launches as part of KDE startup, a panic ensues.

Boot messages:

Starting Open Sound System
ich0: [ITHREAD]
ich0: <Nvidia nForce4> port 0xdc00-0xdcff,0xe000-0xe0ff mem
0xda003000-0xda003fff irq 23 at device 4.0 on pci0

/dev/sndstat:

OSS 4.0 (b1015/200805312359) BSD (C) 4Front Technologies 1996-2008
Kernel: FreeBSD 8.0-CURRENT #4: Wed May 28 11:02:36 PDT 2008
    root@lizzy.catnook.local:/usr/obj/usr/src/sys/LIZZY


Audio devices:
0: Nvidia nForce4 (DUPLEX)
1: Nvidia nForce4 (DUPLEX)
2: Nvidia nForce4 S/PDIF out (OUTPUT)
3: Nvidia nForce4 (VMIX0) (DUPLEX)
4: Nvidia nForce4 (VMIX0) (DUPLEX)
5: Nvidia nForce4 (VMIX0) (DUPLEX)
6: Nvidia nForce4 (VMIX0) (DUPLEX)
7: Nvidia nForce4 (VMIX0) (DUPLEX)
8: Nvidia nForce4 (VMIX0) (DUPLEX)
9: Nvidia nForce4 (VMIX0) (DUPLEX)
10: Nvidia nForce4 (VMIX0) (DUPLEX)

Mixers:
0: ICH AC97 Mixer (ALC850)

lizzy:~/crash% kgdb /usr/obj/usr/src/sys/LIZZY/kernel.debug vmcore.0 
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd"...

Unread portion of the kernel message buffer:
panic: Trying sleep, but thread marked as sleeping prohibited
Uptime: 3m41s
Physical memory: 1527 MB
Dumping 157 MB: 142 126 110 94 78 62 46 30 14

Reading symbols from /boot/kernel/linprocfs.ko...Reading symbols from /boot/kernel/linprocfs.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/linprocfs.ko
Reading symbols from /boot/kernel/linux.ko...Reading symbols from /boot/kernel/linux.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/linux.ko
Reading symbols from /boot/kernel/if_nfe.ko...Reading symbols from /boot/kernel/if_nfe.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/if_nfe.ko
Reading symbols from /boot/kernel/miibus.ko...Reading symbols from /boot/kernel/miibus.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/miibus.ko
Reading symbols from /boot/kernel/tmpfs.ko...Reading symbols from /boot/kernel/tmpfs.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/tmpfs.ko
Reading symbols from /usr/local/lib/oss/modules/osscore.ko...done.
Loaded symbols for /usr/local/lib/oss/modules/osscore.ko
Reading symbols from /usr/local/lib/oss/modules/ich.ko...done.
Loaded symbols for /usr/local/lib/oss/modules/ich.ko
Reading symbols from /usr/local/lib/oss/modules/vmix.ko...done.
Loaded symbols for /usr/local/lib/oss/modules/vmix.ko
Reading symbols from /boot/kernel/daemon_saver.ko...Reading symbols from /boot/kernel/daemon_saver.ko.symbols...done.
done.
Loaded symbols for /boot/kernel/daemon_saver.ko
#0  doadump () at pcpu.h:196
196     pcpu.h: No such file or directory.
        in pcpu.h
(kgdb) bt
#0  doadump () at pcpu.h:196
#1  0xc054942f in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:418
#2  0xc05496a7 in panic (fmt=Variable "fmt" is not available.
) at /usr/src/sys/kern/kern_shutdown.c:572
#3  0xc057a432 in sleepq_add (wchan=0xc47eab60, lock=0x0, wmesg=0xc4ab005f "oss", flags=3, queue=0) at /usr/src/sys/kern/subr_sleepqueue.c:293
#4  0xc0550cf6 in _sx_xlock_hard (sx=0xc47eab60, tid=3300041264, opts=0, file=0x0, line=0) at /usr/src/sys/kern/kern_sx.c:555
#5  0xc4a8866b in __sx_xlock () from /usr/local/lib/oss/modules/osscore.ko
#6  0xc4a922fc in do_outputintr () from /usr/local/lib/oss/modules/osscore.ko
#7  0xc4a92690 in audio_outputintr () from /usr/local/lib/oss/modules/osscore.ko
#8  0xc4b30fb6 in ichintr () from /usr/local/lib/oss/modules/ich.ko
#9  0xc4aae619 in ossintr () from /usr/local/lib/oss/modules/osscore.ko
#10 0xc052c035 in ithread_loop (arg=0xc457f210) at /usr/src/sys/kern/kern_intr.c:1135
#11 0xc0529278 in fork_exit (callout=0xc052be90 <ithread_loop>, arg=0xc457f210, frame=0xe6e0ed38) at /usr/src/sys/kern/kern_fork.c:812
#12 0xc068d0c0 in fork_trampoline () at /usr/src/sys/i386/i386/exception.s:270
(kgdb) q

Is this a locking bug in ich or osscore?

>How-To-Repeat:
Install audio/oss on -current on a system with a Realtek ALC850 audio
controller.

>Fix:


>Release-Note:
>Audit-Trail:

From: Remko Lodder <remko@FreeBSD.org>
To: Jos Backus <jos@catnook.com>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus A8N-SLI
 Premium mobo
Date: Sun, 01 Jun 2008 10:17:28 +0200

 Jos Backus wrote:
 
  From what I understand from the backtrace, one of the arguments passed 
 by the oss modules is faulty which generates the panic. Probably the
 modules are not yet ready for 8.0, would it be possible to test
 7.0-release with these drivers as well? That is our latest official
 release and I would be more worried if that also breaks down.
 
 Thanks,
 remko
 
 -- 
 
 /"\   Best regards,                      | remko@FreeBSD.org
 \ /   Remko Lodder                       | remko@EFnet
   X    http://www.evilcoder.org/          |
 / \   ASCII Ribbon Campaign              | Against HTML Mail and News

From: Jos Backus <jos@catnook.com>
To: Remko Lodder <remko@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus
	A8N-SLI Premium mobo
Date: Sun, 1 Jun 2008 11:47:54 -0700

 On Sun, Jun 01, 2008 at 10:17:28AM +0200, Remko Lodder wrote:
 >  From what I understand from the backtrace, one of the arguments passed 
 > by the oss modules is faulty which generates the panic. Probably the
 > modules are not yet ready for 8.0, would it be possible to test
 > 7.0-release with these drivers as well? That is our latest official
 > release and I would be more worried if that also breaks down.
 
 That will be hard since this is my home desktop which I'd have to downgrade
 (shudder). I'll post the issue on the 4front-tech.com forum. Thanks!

From: Remko Lodder <remko@FreeBSD.org>
To: jos@catnook.com
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus	A8N-SLI
 Premium mobo
Date: Sun, 01 Jun 2008 21:15:39 +0200

 Jos Backus wrote:
 > On Sun, Jun 01, 2008 at 10:17:28AM +0200, Remko Lodder wrote:
 >>  From what I understand from the backtrace, one of the arguments passed 
 >> by the oss modules is faulty which generates the panic. Probably the
 >> modules are not yet ready for 8.0, would it be possible to test
 >> 7.0-release with these drivers as well? That is our latest official
 >> release and I would be more worried if that also breaks down.
 > 
 > That will be hard since this is my home desktop which I'd have to downgrade
 > (shudder). I'll post the issue on the 4front-tech.com forum. Thanks!
 
 Well, Generally I would think it's a bad idea to run 8-current on your 
 desktop... 7.0 is something I can imagine, but 8... do you have specific 
 reasons doing so? (Just curious :))
 
 Thanks && Cheers,
 remko
 
 -- 
 
 /"\   Best regards,                      | remko@FreeBSD.org
 \ /   Remko Lodder                       | remko@EFnet
   X    http://www.evilcoder.org/          |
 / \   ASCII Ribbon Campaign              | Against HTML Mail and News

From: Jos Backus <jos@catnook.com>
To: Remko Lodder <remko@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus
	A8N-SLI Premium mobo
Date: Sun, 1 Jun 2008 13:23:18 -0700

 On Sun, Jun 01, 2008 at 09:15:39PM +0200, Remko Lodder wrote:
 > Well, Generally I would think it's a bad idea to run 8-current on your 
 > desktop... 7.0 is something I can imagine, but 8... do you have specific 
 > reasons doing so? (Just curious :))
 
 I like to live dangerously. :)
 
 My home system has been running -current since 3.0 or so with very few
 problems, and I've reported the occasional bug (as I'm doing now). It's all
 about timing upgrades right and following the mailing lists closely. Tracking
 -current generally means avoiding big release-related bumps, which are
 replaced by lots of mostly smaller bumps.
 
 Groetjes,
 Jos

From: Jos Backus <jos@catnook.com>
To: Remko Lodder <remko@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org, jkim@freebsd.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus
	A8N-SLI Premium mobo
Date: Sun, 1 Jun 2008 13:51:19 -0700

 Commenting out this define
 
     #if __FreeBSD_version >= 700031
     #define USE_SX_LOCK  1
     #endif
 
 in oss-v4.0-build1015-src-bsd/kernel/OS/FreeBSD/wrapper/bsddefs.h and
 reinstalling the port avoids the panic. As a result, KDE system sounds play
 normally and mplayer works, too. So it looks like there's something wrong with
 the way OSS uses sx locks. I'll report this on the 4Front forum.

From: Remko Lodder <remko@FreeBSD.org>
To: jos@catnook.com
Cc: freebsd-gnats-submit@FreeBSD.org, jkim@freebsd.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus	A8N-SLI
 Premium mobo
Date: Sun, 01 Jun 2008 22:51:51 +0200

 Jos Backus wrote:
 > Commenting out this define
 > 
 >     #if __FreeBSD_version >= 700031
 >     #define USE_SX_LOCK  1
 >     #endif
 > 
 > in oss-v4.0-build1015-src-bsd/kernel/OS/FreeBSD/wrapper/bsddefs.h and
 > reinstalling the port avoids the panic. As a result, KDE system sounds play
 > normally and mplayer works, too. So it looks like there's something wrong with
 > the way OSS uses sx locks. I'll report this on the 4Front forum.
 
 OK great! Thanks for the information!! Nice and fast fix ;-)
 
 I suppose we can close the PR on our end?
 
 Thanks again!
 
 -- 
 
 /"\   Best regards,                      | remko@FreeBSD.org
 \ /   Remko Lodder                       | remko@EFnet
   X    http://www.evilcoder.org/          |
 / \   ASCII Ribbon Campaign              | Against HTML Mail and News

From: Jos Backus <jos@catnook.com>
To: Remko Lodder <remko@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org, jkim@freebsd.org
Subject: Re: kern/124174: Panic after installing audio/oss on an Asus
	A8N-SLI Premium mobo
Date: Sun, 1 Jun 2008 15:18:22 -0700

 On Sun, Jun 01, 2008 at 10:51:51PM +0200, Remko Lodder wrote:
 > OK great! Thanks for the information!! Nice and fast fix ;-)
  
 Yeah. I've seen some reports of eventual lockups with this change but things
 have been working okay for a few hours now.
 
 > I suppose we can close the PR on our end?
 
 Sure. It's been reported on the vendor's website here:
 
     http://4front-tech.com/forum/viewtopic.php?t=2718
 
 If anything pops up on the FreeBSD side I'll submit a a followup.
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 3 02:26:46 UTC 2008 
State-Changed-Why:  
This is an upstream problem and has been reported there. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124174 
State-Changed-From-To: closed->suspended 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 3 02:28:13 UTC 2008 
State-Changed-Why:  
Hmm, on second thought, maybe 'suspended' is better for this, since it is 
still a problem. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124174 
State-Changed-From-To: suspended->feedback 
State-Changed-By: eadler 
State-Changed-When: Mon May 7 04:02:18 UTC 2012 
State-Changed-Why:  
Is this still an issue on modern versions? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124174 
State-Changed-From-To: feedback->closed 
State-Changed-By: jh 
State-Changed-When: Fri Oct 5 08:25:48 UTC 2012 
State-Changed-Why:  
Feedback timeout. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=124174 
>Unformatted:
