From batuto@yb3791.spb.edu  Sat Nov 30 06:08:32 2002
Return-Path: <batuto@yb3791.spb.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E38D837B401
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Nov 2002 06:08:32 -0800 (PST)
Received: from wg.pu.ru (wg.pu.ru [193.124.85.219])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 1410D43E4A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 30 Nov 2002 06:08:31 -0800 (PST)
	(envelope-from batuto@yb3791.spb.edu)
Received: (from uucp@localhost)
	by wg.pu.ru (8.9.1a/8.9.1) with UUCP id OAA19063
	for FreeBSD-gnats-submit@freebsd.org; Sat, 30 Nov 2002 14:08:29 GMT
Received: by yb3791.spb.edu (Postfix, from userid 1000)
	id 88D951D80; Sat, 30 Nov 2002 15:43:05 +0300 (MSK)
Message-Id: <20021130124305.88D951D80@yb3791.spb.edu>
Date: Sat, 30 Nov 2002 15:43:05 +0300 (MSK)
From: "Yan V.Batuto" <batuto@wgc.chem.pu.ru>
Reply-To: "Yan V.Batuto" <batuto@wgc.chem.pu.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Kernel trap 12 in sound/pcm code
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         45871
>Category:       kern
>Synopsis:       Kernel trap 12 in sound/pcm code
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 30 06:10:01 PST 2002
>Closed-Date:    Wed Feb 26 07:02:26 PST 2003
>Last-Modified:  Wed Feb 26 07:02:26 PST 2003
>Originator:     Yan V. Batuto
>Release:        FreeBSD 4.7-STABLE i386
>Organization:
St. Petersburg State University
>Environment:
System: FreeBSD 4.7-STABLE #0: Fri Nov 29 01:05:16 MSK 2002 i386
Motherboard: JetWay V333U (VIA KT333 with VT8235 south bridge)
pcm0: <VIA VT8235> port 0xe400-0xe4ff irq 5 at device 17.5 on pci0
	
>Description:
	
Kernel crashes usually during KDE initialization. It depends on
KDE configuration ("rm -rf ~/.kde && startx startkde" never
crashed yet, and AC'97 sound worked OK), and hw.snd.pcm0.vchans
setting. Kernel trap with hw.snd.pcm0.vchans=4 at least much
more probable than with vchans=0.

Trap occurs in dev/sound/pcm/feeder_rate.c:171
==== from gdb session ====
165                     alpha += info->srcinc;
166                     spos += (alpha >> 16) * 2;
167                     alpha &= 0xffff;
168
169             }
170             info->alpha = alpha & 0xffff;
171             info->buffer[0] = info->buffer[spos - hidelta];
172             info->buffer[1] = info->buffer[spos - hidelta + 1];

(kgdb) print spos-hidelta
$1 = -2
(kgdb) print info->buffer[spos-hidelta]
Cannot access memory at address 0xc0fe0ffc.
==== from gdb session ====

>How-To-Repeat:
	

>Fix:
As a ugly workaround try to 
sysctl -w hw.snd.pcm0.vchans=0
but I'm NOT sure it is sufficiently.
	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: orion 
State-Changed-When: Wed Feb 26 06:58:24 PST 2003 
State-Changed-Why:  
The offending code has been completely re-written and tested with 
every possible rate conversion.  It will be in 4.8R that is to be 
released mid-March.   

The new file will work with earlier releases: 
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/dev/sound/pcm/feeder_rate.c?rev=1.2.2.3&content-type=text/x-cvsweb-markup 

Thanks for the report. 
- Orion 


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