Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4961343
Votes 0
Synopsis TEST_BUG: Regression-test javax/sound/sampled/Clip/ClipFlushCrash.java fails
Category java:classes_sound
Reported Against tiger-beta
Release Fixed
State 11-Closed, duplicate of 4958917, bug
Priority: 3-Medium
Related Bugs 4958917
Submit Date 01-DEC-2003
Description




Filed By       : J2SE-SQA [j2se-tck-  xxxxx@xxxxx  ]
JDK            : JDK1.5.0-b29, JDK1.5.0-b29
                  (this is a new test which is absent in previous JDK builds)
Testbase       : Regression-test
Platform[s]    : Suse Linux 8.2 (GNOME2)
switch/Mode    : -client
Falling test[s]: javax/sound/sampled/Clip/ClipFlushCrash.java

Regression-test javax/sound/sampled/Clip/ClipFlushCrash.java test fails with timeout
using JDK1.5.0-b29.

It seems like the test fails because of synchronization problems:

Here is the test source fragment:

--------- ClipFlushCrash.java ---------
...
     68            AT at4 = new AT(clip, "open/close thread", 600) {
     69            public synchronized void doAction() throws Exception {
     70                log("close");
     71                clip.close();
     72                wait(50);
     73                if (!terminated) {
     74                    log("open");
     75                    bais.reset();
     76                    clip.open(new AudioInputStream(bais, format, frameCount));
     77                }
     78            }
     79            };
     80
     81            out(" clip.start");
     82            clip.start();
     83            out(" for 10 seconds, call start/stop, setFramePosition, and flush from other threads");
     84            at1.start();
     85            at2.start();
     86            at3.start();
     87            at4.start();
     88            try {
     89                Thread.sleep(10000);
     90            } catch (InterruptedException ie) {}
     91            out(" finished.");
     92            at1.terminate();
     93            at2.terminate();
     94            at3.terminate();
     95            at4.terminate();
     96            out(" clip.close()");
     97            clip.close();
     98            success++;
...
---------------------------------------

Problem is that at4 can be closed when the main thread tries to terminate it, so the test hangs
at the line 95 and never finishes.

The test stable passes if I increase waiting time at the line 72:
...
     72                wait(10000);
...

Test source location:
=====================
/java/re/jdk/1.5.0/promoted/latest/ws/j2se/test/javax/sound/sampled/Clip/ClipFlushCrash.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b29/regtest/linux/suse8.2_gnome_linux-2/workDir/test/javax/sound/sampled/Clip/ClipFlushCrash.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

#Paths in Java Software:
JT_HOME="/java/re/jct-tools/3.1.2/archive/fcs/binaries"
JEMMY_JAR="/net/jdk/export/jpse04/Jemmy/jemmy.jar"
JAVA_HOME="/java/re/jdk/1.5.0/promoted/all/b29/binaries/linux-i586"
TEST_BASE_PATH="/java/re/jdk/1.5.0/promoted/all/b29/ws/j2se/test"

#Alternative paths outside Java Software:
#JT_HOME="/net/koori.sfbay/onestop/jct-tools/3.1.2/archive/fcs/binaries"
#JEMMY_JAR="/net/jdk/export/jpse04/Jemmy/jemmy.jar"
#JAVA_HOME="/net/koori.sfbay/onestop/jdk/1.5.0/promoted/all/b29/binaries/linux-i586"
#TEST_BASE_PATH="/net/koori.sfbay/onestop/jdk/1.5.0/promoted/all/b29/ws/j2se/test"

TESTVMOPTS="-client"
CLASSPATH="$JT_HOME/classes:$JT_HOME/lib/javatest.jar:$JT_HOME/lib/jtreg.jar"
TEST="javax/sound/sampled/Clip/ClipFlushCrash.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=$JEMMY_JAR,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-2" -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:(26/927)----------
Using default mixer
  got clip:   xxxxx@xxxxx  
  no direct audio clip -> do not test.
Using mixer:   xxxxx@xxxxx  
  got clip: com.sun.media.sound.DirectAudioDevice$  xxxxx@xxxxx  
  open
  clip.start
  for 10 seconds, call start/stop, setFramePosition, and flush from other threads
    flush thread: start
    start/stop thread: start
    setFramePosition thread: start
    open/close thread: start
    setFramePosition thread: setPosition to frame 40306
    flush thread: flush
    setFramePosition thread: setPosition to frame 404637
    setFramePosition thread: setPosition to frame 393964
    flush thread: flush
    start/stop thread: stop
    setFramePosition thread: setPosition to frame 340047
    flush thread: flush
    open/close thread: close
    start/stop thread: start
  finished.
    flush thread: terminate
    setFramePosition thread: terminate
    start/stop thread: terminate
----------System.err:(0/0)----------
result: Failed. Execution failed: Program `/net/linux-15/export/home/java/jdk1.5.0/linux.shared/bin/java' interrupted! (timed out?)

test result: Failed. Execution failed: Program `/net/linux-15/export/home/java/jdk1.5.0/linux.shared/bin/java' interrupted! (timed out?)

Specific machine info:
======================
Hostname: linux-2
OS: Suse Linux 8.2 (GNOME2)

======================================================================
Work Around
N/A
Evaluation
I think that this is not only a synchronization problem in the test case -- I could only produce this problem on Linux.
  xxxxx@xxxxx   2003-12-01
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang