NetBSD Problem Report #52889

From gson@gson.org  Tue Jan  2 21:53:40 2018
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8D8CC7A19A
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  2 Jan 2018 21:53:40 +0000 (UTC)
Message-Id: <20180102215330.61F4E9892B4@guava.gson.org>
Date: Tue,  2 Jan 2018 23:53:30 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: amd64 panic during audio tests
X-Send-Pr-Version: 3.95

>Number:         52889
>Category:       kern
>Synopsis:       amd64 panic during audio tests
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 02 21:55:00 +0000 2018
>Closed-Date:    Tue Jan 09 16:05:45 +0000 2018
>Last-Modified:  Tue Jan 09 16:05:45 +0000 2018
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2017.12.27.21.34.12
>Organization:

>Environment:
System: NetBSD
Architecture: x86_64
Machine: amd64
>Description:

I ran the ATF tests on physical amd64 hardware, a 12-core HP DL369 G7
server, and they triggered a panic.  Here's the relevant part of the
serial console output:

    varcmd: [0.108315s] Passed.
    varmisc: [0.110863s] Passed
    varshell: [0.100081s] Passed
[14.685181s]

usr.bin/mpad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture, mmap
pad0: Virtual format configured - Format SLINEAR, precision 16, channels 2, frequency 44100
pad0: Latency: 139 milliseconds
spkr1 at audio0: PC Speaker (synthesized)
wsbell at spkr1 not configured
spkr1: detached
ixerctl/t_mixerctl (532/729): 4 test cases
    nflag: audio0: detached
pad0: detached
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture, mmap
pad0: Virtual format configured - Format SLINEAR, precision 16, channels 2, frequency 44100
pad0: Latency: 139 milliseconds
spkr1 at audio0: PC Speaker (synthesized)
wsbell at spkr1 not configured
spk[r1: detached
0.877622s] Passed.
    noargaudio0: detached
s_usage: [0.011678s] Skipped: no audipad0: detached
audio1 at pad0uvm_fault(0xffffffff8154a580, 0xffff80006708b000, 2) -> e
fatal page fault in supervisor mode
trap type 6 code 0x2 rip 0xffffffff80224d4c cs 0x8 rflags 0x10246 cr2 0xffff80006708b040 ilevel 0 rsp 0xffffe40158e87638
curlwp 0xffffe40bb11b9b40 pid 8882.1 lowest kstack 0xffffe40158e842c0
panic: trap
cpu0: Begin traceback...
vpanic() at netbsd:vpanic+0x140
snprintf() at netbsd:snprintf
trap() at netbsd:trap+0xcd2
--- trap (number 6) ---
mutex_enter() at netbsd:mutex_enter+0xc
config_attach_loc() at netbsd:config_attach_loc+0x17a
config_found_sm_loc() at netbsd:config_found_sm_loc+0x48
audio_attach_mi() at netbsd:audio_attach_mi+0x32
pad_open() at netbsd:pad_open+0x1ba
spec_open() at netbsd:spec_open+0x260
VOP_OPEN() at netbsd:VOP_OPEN+0x33
vn_open() at netbsd:vn_open+0x1ed
do_open() at netbsd:do_open+0x112
do_sys_openat() at netbsd:do_sys_openat+0x68
sys_open() at netbsd:sys_open+0x24
syscall() at netbsd:syscall+0x1d8
--- syscall (number 5) ---
7c5ae8a3e95a:
cpu0: End traceback...

dumping to dev 4,1 (offset=2226, size=12580302):
dump 1935 1934 1933 1932 [etc]

This server doesn't have any physical audio devices, only the "pad" device.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52889 CVS commit: src/sys/dev
Date: Tue, 9 Jan 2018 04:10:27 +0000

 Module Name:	src
 Committed By:	nat
 Date:		Tue Jan  9 04:10:27 UTC 2018

 Modified Files:
 	src/sys/dev: audio.c

 Log Message:
 Rework of play/rec threads to ensure effective use of locks.

 Addresses part of PR kern/52889 where the mixing thread would not exit on
 audio detach.


 To generate a diff of this commit:
 cvs rdiff -u -r1.447 -r1.448 src/sys/dev/audio.c

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

From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52889 CVS commit: src/sys/dev
Date: Tue, 9 Jan 2018 04:14:21 +0000

 Module Name:	src
 Committed By:	nat
 Date:		Tue Jan  9 04:14:21 UTC 2018

 Modified Files:
 	src/sys/dev: audio.c

 Log Message:
 Forcefully detach children of audio instances.

 This addresses part of PR kern/52889 as children of pad(4) were not
 detaching.


 To generate a diff of this commit:
 cvs rdiff -u -r1.448 -r1.449 src/sys/dev/audio.c

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

From: "Nathanial Sloss" <nat@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52889 CVS commit: src/sys/dev/pad
Date: Tue, 9 Jan 2018 04:23:59 +0000

 Module Name:	src
 Committed By:	nat
 Date:		Tue Jan  9 04:23:59 UTC 2018

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

 Log Message:
 Fix pad on systems with many cores/cpus:

 	* Introduce a lock to serialize attach/detach of pad devices.
 	* Forcefully detach children of pad on close.
 	* Be more carefull in pad_open with regards to config_detach only
 	  if new instances of the pad device are created and fail to open.

 Addresses PR kern/52889.

 These changes were developed with and tested by pgoyette@.


 To generate a diff of this commit:
 cvs rdiff -u -r1.49 -r1.50 src/sys/dev/pad/pad.c

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

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 09 Jan 2018 16:05:45 +0000
State-Changed-Why:
Fixed.  Thanks to nat@ and pgoyette@.


>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-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.