NetBSD Problem Report #55876

From gson@gson.org  Mon Dec 14 10:04:28 2020
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 53E1F1A923C
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 14 Dec 2020 10:04:28 +0000 (UTC)
Message-Id: <20201214100423.06DF2253EDE@guava.gson.org>
Date: Mon, 14 Dec 2020 12:04:23 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: sparc tests hang at lib/libossaudio/t_ossaudio
X-Send-Pr-Version: 3.95

>Number:         55876
>Category:       port-sparc
>Synopsis:       sparc tests hang at lib/libossaudio/t_ossaudio
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    port-sparc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Dec 14 10:05:01 +0000 2020
>Last-Modified:  Sat Dec 26 16:50:02 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current
>Organization:
>Environment:
System: NetBSD
Architecture: sparc
Machine: sparc
>Description:

The sparc test runs on the TNF testbed are failing with a timeout
since December 11.  They appear to hang while running the
lib/libossaudio/t_ossaudio test.

The problem started during the period of build breakage that began
with the commit of that test:

  2020.12.11.12.29.27 nia src/tests/lib/Makefile 1.34
  2020.12.11.12.29.28 nia src/tests/lib/libossaudio/Makefile 1.1
  2020.12.11.12.29.28 nia src/tests/lib/libossaudio/t_ossaudio.c 1.1

Presumably the new test has exposed an existing bug in the sparc audio code.

Logs:

  http://releng.netbsd.org/b5reports/sparc/commits-2020.12.html#2020.12.12.03.03.14

>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@netbsd.org
Cc: nia@NetBSD.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 11:15:13 +0100

 FWIW, on four real sparc machines I get:

 Sparc Station 20:

 Tests root: /usr/tests/lib/libossaudio

 t_ossaudio (1/1): 4 test cases
     oss_dsp_caps: [0.354298s] Passed.
     oss_dsp_init: [0.301715s] Passed.
     oss_dsp_trigger_read: [0.217506s] Passed.
     oss_dsp_trigger_write: [0.215174s] Passed.
 [1.110639s]

 Summary for 1 test programs:
     4 passed test cases.
     0 failed test cases.
     0 expected failed test cases.
     0 skipped test cases.

 Sparc Station LX:

 Tests root: /usr/tests/lib/libossaudio

 t_ossaudio (1/1): 4 test cases
     oss_dsp_caps: [1.020135s] Skipped: No testable audio device available
     oss_dsp_init: [0.485238s] Skipped: Audio device unavailable for playback
     oss_dsp_trigger_read: [0.478146s] Skipped: Audio device unavailable for recording
     oss_dsp_trigger_write: [0.479721s] Skipped: Audio device unavailable for playback
 [2.683883s]

 Summary for 1 test programs:
     0 passed test cases.
     0 failed test cases.
     0 expected failed test cases.
     4 skipped test cases.

 Java Station Krups:

 Tests root: /usr/tests/lib/libossaudio

 t_ossaudio (1/1): 4 test cases
     oss_dsp_caps: [0.526702s] Passed.
     oss_dsp_init: [0.432928s] Failed: ioctl failed
     oss_dsp_trigger_read: [0.323718s] Passed.
     oss_dsp_trigger_write: [0.322947s] Passed.
 [1.733396s]

 Failed test cases:
     t_ossaudio:oss_dsp_init

 Summary for 1 test programs:
     3 passed test cases.
     1 failed test cases.
     0 expected failed test cases.
     0 skipped test cases.


 The latter ist not very informative, ktrace says:

   2038   2038 t_ossaudio CALL  ioctl(3,AUDIO_SETINFO,0xe7fff188)
   2038   2038 t_ossaudio GIO   fd 3 wrote 136 bytes
        "\0\0\M-;\M^@\0\0\0\^B\0\0\0 \0\0\0\^F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
         \0\^B\M-P\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\M-;\M^@\0\0\0\
         \^B\0\0\0 \0\0\0\^F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\0\0\0\0\
         \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\M-p\0\0\0\0\^C\0\0\0\^B\0\0\
         \0\0\0\0\0\^E"
   2038   2038 t_ossaudio RET   ioctl -1 errno 22 Invalid argument


 The hardware is:

 audiocs0 at ebus0 bar 14 offset 0x200000 line 3: CS4231A
 audio0 at audiocs0: playback, capture, full duplex
 audio0: slinear_be:16 -> slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for playback
 audio0: slinear_be:16 <- slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for recording


 So I would claim this is a QEMU bug.

 Martin

From: nia <nia@NetBSD.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 10:40:17 +0000

 On Mon, Dec 14, 2020 at 11:15:13AM +0100, Martin Husemann wrote:
 > t_ossaudio (1/1): 4 test cases
 >     oss_dsp_caps: [0.526702s] Passed.
 >     oss_dsp_init: [0.432928s] Failed: ioctl failed
 >     oss_dsp_trigger_read: [0.323718s] Passed.
 >     oss_dsp_trigger_write: [0.322947s] Passed.
 > [1.733396s]
 > 
 > Failed test cases:
 >     t_ossaudio:oss_dsp_init
 > 
 > Summary for 1 test programs:
 >     3 passed test cases.
 >     1 failed test cases.
 >     0 expected failed test cases.
 >     0 skipped test cases.
 > 
 > 
 > The latter ist not very informative, ktrace says:
 > 
 >   2038   2038 t_ossaudio CALL  ioctl(3,AUDIO_SETINFO,0xe7fff188)
 >   2038   2038 t_ossaudio GIO   fd 3 wrote 136 bytes
 >        "\0\0\M-;\M^@\0\0\0\^B\0\0\0 \0\0\0\^F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
 >         \0\^B\M-P\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\M-;\M^@\0\0\0\
 >         \^B\0\0\0 \0\0\0\^F\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\^A\0\0\0\0\0\0\0\
 >         \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\M-p\0\0\0\0\^C\0\0\0\^B\0\0\
 >         \0\0\0\0\0\^E"
 >   2038   2038 t_ossaudio RET   ioctl -1 errno 22 Invalid argument
 > 
 > 
 > The hardware is:
 > 
 > audiocs0 at ebus0 bar 14 offset 0x200000 line 3: CS4231A
 > audio0 at audiocs0: playback, capture, full duplex
 > audio0: slinear_be:16 -> slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for playback
 > audio0: slinear_be:16 <- slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for recording
 > 
 > 
 > So I would claim this is a QEMU bug.
 > 
 > Martin

 Might be a NetBSD bug if the driver on the actual machines is different
 from the driver used by QEMU.

 The last failing test case is the only surprising one. What line of the
 test case is it failing on?

From: Martin Husemann <martin@duskware.de>
To: nia <nia@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 11:50:59 +0100

 On Mon, Dec 14, 2020 at 10:40:17AM +0000, nia wrote:
 > Might be a NetBSD bug if the driver on the actual machines is different
 > from the driver used by QEMU.

 Qemu emulates a SparcStation 5 (which I don't have), but the audio
 hardware is nearly identical to the krups:

 QEMU:

 [   1.0000030] audiocs0 at sbus0 slot 4 offset 0xc000000 level 5 (ipl 9): CS4231A
 [   1.0000030] audio0 at audiocs0: playback, capture, full duplex
 [   1.0000030] audio0: slinear_be:16 -> slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for playback
 [   1.0000030] audio0: slinear_be:16 <- slinear_le:16 2ch 48000Hz, blk 7680 bytes (40ms) for recording

 > The last failing test case is the only surprising one. What line of the
 > test case is it failing on?

 It does not tell ;-)

 tc-start: 1607942722.435372, oss_dsp_init
 tc-end: 1607942722.867265, oss_dsp_init, failed, ioctl failed

 Martin

From: nia <nia@NetBSD.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 11:29:29 +0000

 On Mon, Dec 14, 2020 at 11:50:59AM +0100, Martin Husemann wrote:
 > > The last failing test case is the only surprising one. What line of the
 > > test case is it failing on?
 > 
 > It does not tell ;-)
 > 
 > tc-start: 1607942722.435372, oss_dsp_init
 > tc-end: 1607942722.867265, oss_dsp_init, failed, ioctl failed
 > 
 > Martin

 I've made the error messages more verbose - should help.

From: Martin Husemann <martin@duskware.de>
To: nia <nia@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 13:23:19 +0100

 On Mon, Dec 14, 2020 at 11:29:29AM +0000, nia wrote:
 > I've made the error messages more verbose - should help.

 tc-start: 1607948447.456871, oss_dsp_init
 tc-end: 1607948447.901199, oss_dsp_init, failed, ioctl SNDCTL_DSP_SPEED (0) failed

 Here is more info about the device:

 # mixerctl -a
 inputs.dac=220,220
 inputs.dac.mute=off
 inputs.line=220,220
 inputs.line.mute=off
 inputs.mic=0
 inputs.mic.mute=on
 inputs.cd=220,220
 inputs.cd.mute=off
 outputs.monitor=0
 outputs.monitor.mute=on
 outputs.master=240,240
 outputs.mono=off
 record.record=220,220
 record.record.source=mic
 # audioctl -a
 name=cs4231
 version=x
 config=audio
 encodings=mulaw:8*,alaw:8*,slinear:8*,ulinear:8*,slinear_le:16*,ulinear_le:16*,slinear_be:16*,ulinear_be:16*,slinear_le:32*,ulinear_le:32*,slinear_be:32*,ulinear_be:32*
 properties=full_duplex,mmap
 full_duplex=1
 fullduplex=1
 blocksize=2048
 hiwat=32
 lowat=24
 monitor_gain=0
 mode=
 play.rate=8000
 play.channels=1
 play.precision=8
 play.encoding=mulaw
 play.gain=240
 play.balance=32
 play.port=0x0
 play.avail_ports=0x0
 play.seek=0
 play.samples=0
 play.eof=0
 play.pause=0
 play.error=0
 play.waiting=0
 play.open=0
 play.active=0
 play.buffer_size=65536
 record.rate=8000
 record.channels=1
 record.precision=8
 record.encoding=mulaw
 record.gain=220
 record.balance=32
 record.port=0x1
 record.avail_ports=0x3
 record.seek=0
 record.samples=0
 record.eof=0
 record.pause=1
 record.error=0
 record.waiting=0
 record.open=0
 record.active=0
 record.buffer_size=65536
 record.errors=0

 Martin

From: nia <nia@NetBSD.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 15:06:02 +0000

 On Mon, Dec 14, 2020 at 01:23:19PM +0100, Martin Husemann wrote:
 > On Mon, Dec 14, 2020 at 11:29:29AM +0000, nia wrote:
 > > I've made the error messages more verbose - should help.
 > 
 > tc-start: 1607948447.456871, oss_dsp_init
 > tc-end: 1607948447.901199, oss_dsp_init, failed, ioctl SNDCTL_DSP_SPEED (0) failed

 "audiocfg list" would be useful to see.
 I suspect, if your userspace is up to date, this has uncovered a bug.

From: Martin Husemann <martin@duskware.de>
To: nia <nia@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 16:23:19 +0100

 On Mon, Dec 14, 2020 at 03:06:02PM +0000, nia wrote:
 > "audiocfg list" would be useful to see.
 > I suspect, if your userspace is up to date, this has uncovered a bug.

 Userland is from saturday, cvs update completed at 2020-12-12 18:57 UTC

 0: [*] audio0 @ audiocs0: cs4231 x
        playback: 2ch, 48000Hz
        record:   2ch, 48000Hz
        (PR) slinear_le 16/16, 2ch, { 8000, 11025, 16000, 22050, 44100, 48000 }

 Martin

From: Andreas Gustafsson <gson@gson.org>
To: nia <nia@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Mon, 14 Dec 2020 19:51:26 +0200

 nia wrote:
 >  I've made the error messages more verbose - should help.

 A test log with this change is now available:

   http://releng.netbsd.org/b5reports/sparc/2020/2020.12.14.11.42.44/test.log

 -- 
 Andreas Gustafsson, gson@gson.org

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: gnats-bugs@netbsd.org
Cc: port-sparc-maintainer@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org,
	gson@gson.org (Andreas Gustafsson)
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Tue, 15 Dec 2020 16:39:03 +0900

 At Mon, 14 Dec 2020 15:10:01 +0000 (UTC),
 nia wrote:
 >  "audiocfg list" would be useful to see.
 >  I suspect, if your userspace is up to date, this has uncovered a bug.

 AUDIO_SETINFO requires to be set to -1 for items that you don't want
 to change.  But AUDIO_GETBUFINFO returns(fills) 0 for untouched items.
 Therefore you can't reuse audio_info_t you get from AUDIO_GETBUFINFO.
 This has been the behavior since AUDIO_GETBUFINFO was first committed
 in 2007.  (and it's undocumented...)

 This patch (for libossaudio) fixes oss_dsp_init test.
 # But the next test hangs (on sparc/qemu).  While a quick look,
 # audiocs(4) seems to have another problem...)

 --- src/lib/libossaudio/ossaudio.c.ORG	2020-12-07 19:03:36.348518216 +0900
 +++ src/lib/libossaudio/ossaudio.c	2020-12-15 13:44:06.157851712 +0900
 @@ -183,12 +183,12 @@
  		/* This call is merely advisory, and may be a nop. */
  		break;
  	case SNDCTL_DSP_SPEED:
 -		AUDIO_INITINFO(&tmpinfo);
  		/*
  		 * In Solaris, 0 is used a special value to query the
  		 * current rate. This seems useful to support.
  		 */
  		if (INTARG == 0) {
 +			AUDIO_INITINFO(&tmpinfo);
  			retval = ioctl(fd, AUDIO_GETBUFINFO, &tmpinfo);
  			if (retval < 0)
  				return retval;
 @@ -204,6 +204,7 @@
  		 * NetBSD will reject unsupported sample rates, but OSS
  		 * applications need to be able to negotiate a supported one.
  		 */
 +		AUDIO_INITINFO(&tmpinfo);
  		if (INTARG < 1000)
  			INTARG = 1000;
  		if (INTARG > 192000)


 By the way, I personally think this AUDIO_GETBUFINFO behavior (in the
 kernel) is very confusing.  But I don't know whether this behavior was
 intended or not.  (So I kept it during my audio development to avoid
 any other confusions)
 Should we change it now?

 Thanks,
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Martin Husemann <martin@duskware.de>
To: nia <nia@NetBSD.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Tue, 15 Dec 2020 14:39:45 +0100

 For completeness: I remembered I have a U2 machine which has exactly the
 same sbus CS4231 hardware as the emulated Sparc Station 5. Running the
 test there:

 Tests root: /usr/tests/lib/libossaudio

 t_ossaudio (1/1): 4 test cases
     oss_dsp_caps: [0.096728s] Passed.
     oss[ 6867.4946664] audio0: setting record.port=0 failed with 22
 _dsp_init: [0.101637s] Failed: ioct

 [ 6867.5946704] audiocs0: unhandled csr=0x7eab6004<IP,CI,IE,CIE,EIE,PM,PD,CGO>

 l SNDCTL_DSP_SPEED (0) failed
     oss_dsp_trigger_read: [0.117737s] Passed.
     oss_dsp_trigger_write: [0.034434s] Passed.
 [0.355829s]

 Failed test cases:
     t_ossaudio:oss_dsp_init

 Summary for 1 test programs:
     3 passed test cases.
     1 failed test cases.
     0 expected failed test cases.
     0 skipped test cases.

 Martin

From: nia <nia@NetBSD.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@netbsd.org
Subject: Re: port-sparc/55876: sparc tests hang at lib/libossaudio/t_ossaudio
Date: Tue, 15 Dec 2020 13:52:29 +0000

 On Tue, Dec 15, 2020 at 02:39:45PM +0100, Martin Husemann wrote:
 >     oss[ 6867.4946664] audio0: setting record.port=0 failed with 22

 Looks like a driver bug.

From: "Nia Alarie" <nia@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55876 CVS commit: src/lib/libossaudio
Date: Sat, 19 Dec 2020 12:55:28 +0000

 Module Name:	src
 Committed By:	nia
 Date:		Sat Dec 19 12:55:28 UTC 2020

 Modified Files:
 	src/lib/libossaudio: ossaudio.c

 Log Message:
 ossaudio(3): Do not reuse results from AUDIO_GETBUFINFO in SETINFO

 Should help PR 55876.


 To generate a diff of this commit:
 cvs rdiff -u -r1.64 -r1.65 src/lib/libossaudio/ossaudio.c

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

From: "Andreas Gustafsson" <gson@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55876 CVS commit: src/tests/lib/libossaudio
Date: Sat, 26 Dec 2020 15:28:52 +0000

 Module Name:	src
 Committed By:	gson
 Date:		Sat Dec 26 15:28:52 UTC 2020

 Modified Files:
 	src/tests/lib/libossaudio: t_ossaudio.c

 Log Message:
 Disable the lib/libossaudio/t_ossaudio:oss_dsp_trigger_read test case
 on sparc until PR port-sparc/55876 gets fixed.


 To generate a diff of this commit:
 cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libossaudio/t_ossaudio.c

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

From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@netbsd.org, "Nia Alarie" <nia@netbsd.org>
Cc: 
Subject: Re: PR/55876 CVS commit: src/lib/libossaudio
Date: Sat, 26 Dec 2020 18:45:44 +0200

 On Dec 19, Nia Alarie wrote:
 >  ossaudio(3): Do not reuse results from AUDIO_GETBUFINFO in SETINFO
 >  
 >  Should help PR 55876.
 >  
 >  To generate a diff of this commit:
 >  cvs rdiff -u -r1.64 -r1.65 src/lib/libossaudio/ossaudio.c

 After this change, the oss_dsp_init test case no longer fails.
 That's good, but it does not fix the problem the PR is about, the
 system hanging during the subsequent oss_dsp_trigger_read test case.
 I have now disabled the oss_dsp_trigger_read test case on sparc so
 that the rest of the tests can run.
 -- 
 Andreas Gustafsson, gson@gson.org

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.