From owner-freebsd-current@FreeBSD.ORG Sun Jan 18 05:43:42 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E52916A4CE for ; Sun, 18 Jan 2004 05:43:42 -0800 (PST) Received: from email06.aon.at (WARSL402PIP3.highway.telekom.at [195.3.96.75]) by mx1.FreeBSD.org (Postfix) with SMTP id 25E2D43D5D for ; Sun, 18 Jan 2004 05:43:23 -0800 (PST) (envelope-from shoesoft@gmx.net) Received: (qmail 244644 invoked from network); 18 Jan 2004 13:43:21 -0000 Received: from m085p004.dipool.highway.telekom.at (HELO ?62.46.0.132?) ([62.46.0.132]) (envelope-sender ) by qmail6rs.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 18 Jan 2004 13:43:21 -0000 From: Stefan Ehmann To: Don Lewis In-Reply-To: <200401170915.i0H9FD7E047822@gw.catspoiler.org> References: <200401170915.i0H9FD7E047822@gw.catspoiler.org> Content-Type: text/plain Message-Id: <1074433413.738.16.camel@shoeserv.freebsd> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sun, 18 Jan 2004 14:43:33 +0100 Content-Transfer-Encoding: 7bit cc: current@FreeBSD.org Subject: Re: sound/pcm/* bugs (was: Re: page fault panic tracked down (selwakeuppri()) - really sound/pcm/*) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 18 Jan 2004 13:43:42 -0000 On Sat, 2004-01-17 at 10:15, Don Lewis wrote: > I think this problem can be caused by a transient malloc() M_NOWAIT > failure. > > Changes in this version of the patch: > > When increasing blksz in chn_setblocksize(), increase the size > of bufsoft before increasing bufhard, and decrease bufsoft after > decreasing bufhard in an attempt to avoid the buffer overflow in > feed_vchan_s16(). > > Buffers are now allocated using M_WAITOK, requiring locks to > be dropped for the malloc() calls. This required adding a mutex > parameter to sndbuf_remalloc(). > > Locking order between parent and child channels is changed. The > parent is now locked first and then the child. The list of > children is protected by the parent's lock. There are still > potential race conditions in the vchan creation/destruction code > because all the locks have to be dropped in order to call > malloc(), etc. > > Locking cleaned up to eliminate the need for MTX_RECURSE. > > A new mutex allocator for the channel mutexes was added that > initializes the mutexes with the MTX_DUPOK flags so that multiple > channel mutexes of the same type can be held at once. > > Locking simplification in dsp_ioctl(). > > Added KASSERTs in chn_wrfeed(). Using this patch (and the small changes to avoid the esd problem) I got an assertion triggered in channel.c: chn_wrfeed amt > source size #0 doadump () at /usr/src/sys/kern/kern_shutdown.c:240 #1 0xc04e57c8 in boot (howto=256) at /usr/src/sys/kern/kern_shutdown.c:372 #2 0xc04e5b57 in panic () at /usr/src/sys/kern/kern_shutdown.c:550 #3 0xc07e36cd in chn_wrfeed (c=0xc37a8880) at /usr/src/sys/dev/sound/pcm/channel.c:219 #4 0xc07e377f in chn_wrintr (c=0xc37a8880) at /usr/src/sys/dev/sound/pcm/channel.c:239 #5 0xc07e3f70 in chn_intr (c=0xc37a8880) at /usr/src/sys/dev/sound/pcm/channel.c:485 #6 0xc07fda2f in csa_intr (p=0xc37a8700) at /usr/src/sys/dev/sound/pci/csapcm.c:623 #7 0xc07fc724 in csa_intr (arg=0xc37a8600) at /usr/src/sys/dev/sound/pci/csa.c:532 #8 0xc04d1c62 in ithread_loop (arg=0xc1736b00) at /usr/src/sys/kern/kern_intr.c:544 #9 0xc04d0c54 in fork_exit (callout=0xc04d1ad0 , arg=0x0, frame=0x0) at /usr/src/sys/kern/kern_fork.c:797 In frame #3 amt evaluates to 2176, bufsize is 2048