NetBSD Problem Report #39899

From heas@shrubbery.net  Tue Nov 11 22:53:58 2008
Return-Path: <heas@shrubbery.net>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 2CA0363B898
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 11 Nov 2008 22:53:58 +0000 (UTC)
Message-Id: <20081111225356.359A5108690@guelah.shrubbery.net>
Date: Tue, 11 Nov 2008 22:53:56 +0000 (UTC)
From: heas@shrubbery.net
Reply-To: heas@shrubbery.net
To: gnats-bugs@gnats.NetBSD.org
Subject: audio attach with pad(4) segfaults
X-Send-Pr-Version: 3.95

>Number:         39899
>Category:       kern
>Synopsis:       audio attach with pad(4) segfaults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 11 22:55:00 +0000 2008
>Closed-Date:    Mon Dec 21 17:32:50 +0000 2009
>Last-Modified:  Mon Dec 21 17:32:50 +0000 2009
>Originator:     john heasley
>Release:        NetBSD 5.99.01
>Organization:

>Environment:
System: NetBSD 5.99.01 Sun v20z
Architecture: amd64
Machine: amd64
>Description:
A kernel, with essentially all audio devices removed, segfaults in the
audio(4) attach from pad(4) when audiosetinfo() calls audio_calcwater()
around audio.c:3591 because ((audio_softc *)sc)->sc_pustream is NULL.

As follows with some debug printfs:
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex
audio audiosetinfo: oldpblksize 0, oldrblksize 0
audio audiosetinfo: sc->sc_pr.blksize 1024, sc->sc_rr.blksize 1024
audio audiosetinfo: sc->sc_pustream 0x0, sc->sc_rustream 0x0
audio audiosetinfo: oldpus 0x0, oldrus 0x0
audio audio_calcwater: 0x0
uvm_fault(0xffffffff80842aa0, 0x0, 1) -> e
fatal page fault in supervisor mode
trap type 6 code 0 rip ffffffff802e25d8 cs 8 rflags 10282 cr2  10 cpl 6 rsp ffffffff80954340
kernel: page fault trap, code=0
Stopped in pid 0.1 (system) at  netbsd:audio_calcwater+0x28:    movq    0x10(%rdx),%rax
db{0}> bt     
audio_calcwater() at netbsd:audio_calcwater+0x28
audiosetinfo() at netbsd:audiosetinfo+0x54e
audio_set_defaults() at netbsd:audio_set_defaults+0xdd
audioattach() at netbsd:audioattach+0x18f
config_attach_loc() at netbsd:config_attach_loc+0x14a
audio_attach_mi() at netbsd:audio_attach_mi+0x2d
pad_attach() at netbsd:pad_attach+0xc1
config_attach_pseudo() at netbsd:config_attach_pseudo+0x33
padattach() at netbsd:padattach+0x59
config_finalize() at netbsd:config_finalize+0x5f
main() at netbsd:main+0x242

>How-To-Repeat:
Comment all audio devices except:
audio*  at audiobus?
midi*   at pcppi?               # MIDI interface to the PC speaker
pseudo-device   pad 

>Fix:
audio_calcwater() should check for NULL or audioattach() should initialize
sc_pustream, if sc_pustream is necessary for pad(4)?

>Release-Note:

>Audit-Trail:
From: "Jared D. McNeill" <jmcneill@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39899 CVS commit: src/sys/dev/pad
Date: Tue, 8 Sep 2009 09:47:43 +0000

 Module Name:	src
 Committed By:	jmcneill
 Date:		Tue Sep  8 09:47:43 UTC 2009

 Modified Files:
 	src/sys/dev/pad: files.pad

 Log Message:
 PR# kern/39899: audio attach with pad(4) segfaults

 Make sure pad pulls in auconv mulaw support.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pad/files.pad

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: jmcneill@NetBSD.org
State-Changed-When: Tue, 08 Sep 2009 09:52:24 +0000
State-Changed-Why:
Fixed in -current.


From: Soren Jacobsen <snj@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39899 CVS commit: [netbsd-5] src/sys/dev/pad
Date: Wed, 16 Sep 2009 03:57:49 +0000

 Module Name:	src
 Committed By:	snj
 Date:		Wed Sep 16 03:57:49 UTC 2009

 Modified Files:
 	src/sys/dev/pad [netbsd-5]: files.pad

 Log Message:
 Pull up following revision(s) (requested by jmcneill in ticket #947):
 	sys/dev/pad/files.pad: revision 1.4
 PR# kern/39899: audio attach with pad(4) segfaults
 Make sure pad pulls in auconv mulaw support.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.3.6.1 src/sys/dev/pad/files.pad

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: heas@NetBSD.org
State-Changed-When: Mon, 21 Dec 2009 17:32:50 +0000
State-Changed-Why:
Fix confirmed.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.