JDK-8068412 : [macosx] Initialization of Cocoa hangs if CoreAudio was initialized before
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: 7,8,9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2014-12-23
  • Updated: 2015-09-29
  • Resolved: 2015-05-19
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.
JDK 8 JDK 9
8u60Fixed 9 b54Fixed
Description
Testsuite name:JCK manual
Test name:api/javax_sound/interactive/PlayMidiTests.html#PlayMidiTest
Product tested: JDK 9b43 64bit
OS/architecture:Mac10.9-x64 (Processor:2.4GHz Intel Core i5;Memory:4GB 1600MHz DDR3)
 
Error log file (if present):http://scaaa008.us.oracle.com:9502/runs%2F667363.ManualSubmit-1/workDir/api/javax_sound/interactive/PlayMidiTests_PlayMidiTest.jtr

Reproducible: Always
Reproducible on machine: Evergreen-machine
[If Sometimes] Also reproducible on machine:

Is it a Regression:YES
([If Regression]) Regression introduced in release/build:JDK 9b24(64bit)/Mac 10.9-x64,Fail

Test result on the last GAed release for this train:
([if Fail] Test result on FCS:

Is it a platform specific issue:YES(same build on Solaris10-sparc pass)
Is it a new (previously unsupported) OS/browser/mode testing: NO
([If new configuration testing] Issue specific to execution mode or OS/browser version:)

Steps to reproduce:
1. Install test bundle jdk8u11b06 from http://jre.us.oracle.com/java/re/jdk/9/promoted/ea/b43/bundles/macosx-x86_64/jdk-9-ea-macosx-x86_64.dmg to /Library/Java/JavaVirtualMachines/ 

2. Download the JCK-runtime-9.jar from http://jre.us.oracle.com/java/re/jck/9/promoted/ea/latest/bundles/ to /workspace/jck/ and use /Library/Java/JavaVirtualMachines/jdk1.9.0.jdk/Contents/Home/bin/java -jar JCK-runtime-9.jar to unzip it 

3.Then run this case as following:
/Library/Java/JavaVirtualMachines/jdk1.9.0.jdk/Contents/Home/bin/java -showversion -cp /workspace/jck/JCK-runtime-9/classes:/Library/Java/JavaVirtualMachines/jdk1.9.0.jdk/Contents/Home/lib/tools.jar -Djava.security.policy=/workspace/jck/JCK-runtime-9/lib/jck.policy javasoft.sqe.tests.api.javax.sound.interactive.PlayMidiTest -platform.canPlayMidi true -TestCaseID ALL -TestDirURL file:/workspace/jck/JCK-runtime-9/tests/api/javax_sound/interactive/PlayMidiTests.html#PlayMidiTest -timeoutFactor 1.0
 
Descriptions:

Actual behavior:
1.While the case launching,the test window icon will show in the windows toolbar,but the test window can not show on the desktop,refer to PlayMidiTests.jpg.
2.We can not do the test,and we must kill the process to continue the next test.

These cases have the same issue: 
api/javax_sound/interactive/PlaySoundTest.html#PlaySoundTest
api/javax_sound/interactive/RecordSoundTest.html#RecordSoundTest

Validation:
JDK 9b01(64bit)/Mac 10.9-x64,Pass
JDK 9b11(64bit)/Mac 10.9-x64,Pass
JDK 9b21(64bit)/Mac 10.9-x64,Pass
JDK 9b23(64bit)/Mac 10.9-x64,Pass
JDK 9b24(64bit)/Mac 10.9-x64,Fail
JDK 9b25(64bit)/Mac 10.9-x64,Fail
JDK 9b31(64bit)/Mac 10.9-x64,Fail
JDK 9b32(64bit)/Mac 10.9-x64,Fail
JDK 9b33(64bit)/Mac 10.9-x64,Fail
Comments
Java Sound Demo is affected also: http://www.oracle.com/technetwork/java/index-139508.html
09-02-2015

https://developer.apple.com/library/mac/technotes/tn2091/_index.html
03-02-2015

FindNextComponent and related methods were deprecated in osx >=10.8 and the bug can be reproduced since then on all jdk trains.
03-02-2015

The problem is that NSApplicationDidFinishLaunchingNotification is not coming if we find AudioOutputUnit via FindNextComponent before NSApplication is start.
02-02-2015

Looks like related to JDK-8033367
14-01-2015

Issue can be reproducible at our end. I will analyze it.
24-12-2014

Add case name for aurora RULE api/javax_sound/interactive/PlayMidiTests_PlayMidiTest ExitCode 137 RULE api/javax_sound/interactive/PlaySoundTest_PlaySoundTest ExitCode 137 RULE api/javax_sound/interactive/RecordSoundTest_RecordSoundTest ExitCode 137
23-12-2014