JDK-4915810 : 2 Regression-test sound fails: NPE from Mixer.open()
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_10
  • CPU: x86
  • Submitted: 2003-09-02
  • Updated: 2003-10-10
  • Resolved: 2003-09-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Description

Name: vsR10238			Date: 09/02/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b17
Testbase       : Regression-test
Platform[s]    : Solaris 10 (x86, sparc)
Falling test[s]:
         javax/sound/sampled/Lines/SDLwrite.java
	javax/sound/sampled/Lines/SourceDataLineDefaultBufferSizeCrash.java

2 tests from the regression test suite for JDK1.5.0 fail with JDK1.5.0 (tested with b17, b16),
JDK1.4.2 (tested with b28) on computers without sound or if sound services are unavailable due
to other restrictions.

The tests fail because com.sun.media.sound.SimpleInputDevice.implOpen() called from Mixer.open()
throws NullPointerException.

According to the J2SE 1.5.0 API specification Line.open() inherited by the Mixer interface does not throw
NullPointerException.

javax/sound/sampled/Lines/SourceDataLineDefaultBufferSizeCrash.java is a new test introduced in
the regression test suite for JDK1.5.0-b17.

Test source location:
=====================
/java/re/jdk/1.5.0/promoted/latest/ws/j2se/test/javax/sound/sampled/Lines/SDLwrite.java
/java/re/jdk/1.5.0/promoted/latest/ws/j2se/test/javax/sound/sampled/Lines/SourceDataLineDefaultBufferSizeCrash.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b17/regtest/x86/sol10_x86_gnome_linux-18/workDir/test/javax/sound/sampled/Lines/SDLwrite.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/sh
RESULT_DIR=`pwd`
WORK_DIR=$RESULT_DIR/workDir/test
REPORT_DIR=$RESULT_DIR/reportDir
JT_HOME="/net/linux-15/export/home/java/jct"
JAVA_HOME="/net/linux-15/export/home/java/jdk1.5.0/x86"
TEST_BASE_PATH="/net/linux-15/export/home/java/regtest.tiger/test"
TESTVMOPTS="-client"
CLASSPATH="$JT_HOME/classes:$JT_HOME/lib/javatest.jar:$JT_HOME/lib/jtreg.jar"

TEST="javax/sound/sampled/Lines/SDLwrite.java"

mkdir -p $WORK_DIR/scratch 2>&1
mkdir -p $WORK_DIR/jtData 2>&1
mkdir -p $REPORT_DIR 2>&1

#rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

cd $WORK_DIR/scratch

$JAVA_HOME/bin/java -server -cp $CLASSPATH -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,HOME=$HOME/.regtest,PATH=/bin:/usr/bin,CPAPPEND=$JT_HOME/jemmy/jemmy.jar,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-18" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/$TEST"

--- script end ---


Test output (jtr part):
=======================
----------System.out:(18/921)----------

==> Test for SourceDataLine.write() method for not open and not started line:
## Mixer.open() threw unexpected exception:
#  Mixer = com.sun.media.sound.SimpleInputDevice@111a3ac
java.lang.NullPointerException
	at com.sun.media.sound.SimpleInputDevice.implOpen(SimpleInputDevice.java:261)
	at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:286)
	at com.sun.media.sound.AbstractMixer.open(AbstractMixer.java:277)
	at SDLwrite.run(SDLwrite.java:61)
	at SDLwrite.main(SDLwrite.java:20)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:549)

==> test FAILED!
----------System.err:(13/663)----------
java.lang.Exception: test FAILED!
	at SDLwrite.main(SDLwrite.java:22)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
	at java.lang.Thread.run(Thread.java:549)

JavaTest Message: Test threw exception: java.lang.Exception: test FAILED!
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.lang.Exception: test FAILED!
result: Failed. Execution failed: `main' threw exception: java.lang.Exception: test FAILED!


test result: Failed. Execution failed: `main' threw exception: java.lang.Exception: test FAILED!


Specific machine info:
======================
Hostname: linux-18
OS: Solaris 10 (x86) (GNOME)



======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b22 VERIFIED IN: tiger
14-06-2004

PUBLIC COMMENTS 2 Regression-test sound fails: NPE from Mixer.open()
10-06-2004

EVALUATION ###@###.### 2003-09-26 Easy to fix.
26-09-2003