JDK-4872850 : AudioSystem fails to clean up resources on shutdown
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2003-06-02
  • Updated: 2003-06-02
  • Resolved: 2003-06-02
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 06/02/2003


java version "1.4.2-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

FULL OS VERSION :
Microsoft Windows XP [Version 5.1.2600]
\-> WinXP pro

Linux gala.cime.net 2.4.2-2 #1 Sun Apr 8 19:37:14 EDT 2001 i586 unknown

- Reproducibly under either OS

A DESCRIPTION OF THE PROBLEM :
Once used, AudioSystem will never shutdown properly and resources will potentially leak over time.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run testcase

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Process terminates cleanly once end of main() is reached.
ACTUAL -
Process hangs indefinately.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.sound.sampled.*;
import javax.sound.sampled.DataLine.Info;


public class ShutdownBug
{
  public static void main(String[] args)
  {
    System.out.println("Program init");
    Info info = new javax.sound.sampled.DataLine.Info(SourceDataLine.class, null);
    AudioSystem.isLineSupported(info); //If this line is removed, the main thread shuts down properly
    System.out.println("Program shutdown");
  }
}

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Forcibly shutdown using System.exit()
(Review ID: 186890) 
======================================================================