Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8166942

Usage of SplashScreen Functions hangs up FX Application

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_102"
      Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+136)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+136, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Mac OS X 10.11.6 (Build 15G1004)


      A DESCRIPTION OF THE PROBLEM :
      Using functions of SplashScreen the operation hangs up the app.

      REGRESSION. Last worked in version 9

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_102"
      Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+136)
      Java HotSpot(TM) 64-Bit Server VM (build 9-ea+136, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Start the testcase, it hangs every time.

      It seemed to be a problem with SplashLock Function in the native layer (splashscreen_sys.m, see problem stack trace at "Error Messages").

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      App runs normally.
      ACTUAL -
      App crashes.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Heaviest stack for the main thread of the target process:
        14 start + 52 (java + 6628) [0x10b2229e4]
        14 main + 101 (java + 33986) [0x10b2294c2]
        14 JLI_Launch + 1952 (java + 8588) [0x10b22318c]
        14 CreateExecutionEnvironment + 871 (java + 25701) [0x10b227465]
        14 CFRunLoopRunSpecific + 296 (CoreFoundation + 560856) [0x7fff9bf9fed8]
        14 __CFRunLoopRun + 927 (CoreFoundation + 562399) [0x7fff9bfa04df]
        14 __CFRunLoopDoSources0 + 556 (CoreFoundation + 565180) [0x7fff9bfa0fbc]
        14 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 (CoreFoundation + 698497) [0x7fff9bfc1881]
        14 __NSThreadPerformPerform + 279 (Foundation + 487390) [0x7fff95a09fde]
        14 +[JNFRunLoop _performCopiedBlock:] + 17 (JavaNativeFoundation + 28000) [0x1285c0d60]
        14 __SplashInitPlatform_block_invoke_1 + 360 (libsplashscreen.dylib + 226776) [0x12a0ef5d8]
        14 +[NSApplicationAWT runAWTLoopWithApp:] + 156 (libosxapp.dylib + 8525) [0x12a11314d]
        14 -[NSApplication run] + 682 (AppKit + 249216) [0x7fff95f0cd80]
        14 -[NSApplicationAWT nextEventMatchingMask:untilDate:inMode:dequeue:] + 124 (libosxapp.dylib + 9130) [0x12a1133aa]
        14 -[NSApplication _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454 (AppKit + 295462) [0x7fff95f18226]
        14 _DPSNextEvent + 1067 (AppKit + 298486) [0x7fff95f18df6]
        14 _BlockUntilNextEventMatchingListInModeWithFilter + 71 (HIToolbox + 198063) [0x7fff8dd195af]
        14 ReceiveNextEventCommon + 432 (HIToolbox + 198511) [0x7fff8dd1976f]
        14 RunCurrentEventLoopInMode + 235 (HIToolbox + 198965) [0x7fff8dd19935]
        14 CFRunLoopRunSpecific + 296 (CoreFoundation + 560856) [0x7fff9bf9fed8]
        14 __CFRunLoopRun + 927 (CoreFoundation + 562399) [0x7fff9bfa04df]
        14 __CFRunLoopDoSources0 + 556 (CoreFoundation + 565180) [0x7fff9bfa0fbc]
        14 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 (CoreFoundation + 698497) [0x7fff9bfc1881]
        14 __NSThreadPerformPerform + 279 (Foundation + 487390) [0x7fff95a09fde]
        14 -[GlassRunnable run] + 107 (libglass.dylib + 17819) [0x12e56259b]
        14 jni_CallVoidMethod + 363 (libjvm.dylib + 3239743) [0x10c916f3f]
        14 jni_invoke_nonstatic(JNIEnv_*, JavaValue*, _jobject*, JNICallType, _jmethodID*, JNI_ArgumentPusher*, Thread*) + 748 (libjvm.dylib + 3295089) [0x10c924771]
        14 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710 (libjvm.dylib + 3069410) [0x10c8ed5e2]
        14 ??? [0x10d5a17a7]
        14 ??? [0x10d5a9382]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a90c0]
        14 ??? [0x10d5c0c64]
        14 JVM_DoPrivileged + 1208 (libjvm.dylib + 3464452) [0x10c94dd04]
        14 JavaCalls::call_helper(JavaValue*, methodHandle*, JavaCallArguments*, Thread*) + 1710 (libjvm.dylib + 3069410) [0x10c8ed5e2]
        14 ??? [0x10d5a17a7]
        14 ??? [0x10d5a90c0]
        14 ??? [0x10d5a9382]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a9382]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5a933d]
        14 ??? [0x10d5c0c64]
        14 Java_java_awt_SplashScreen__1close + 50 (libsplashscreen.dylib + 15602) [0x12a0bbcf2]
        14 SplashLock + 37 (libsplashscreen.dylib + 227797) [0x12a0ef9d5]
        14 __psynch_mutexwait + 10 (libsystem_kernel.dylib + 93670) [0x7fff89fdede6]
       *14 psynch_mtxcontinue + 0 (pthread + 25357) [0xffffff7f80f2030d]


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Supply a jpg or png like https://duke.kenai.com/wave/.Midsize/Wave.png.png in root of cp and start java with command like java -splash:Wave.png.png de.test.SplashTest


      package de.test;


      import javafx.application.Application;
      import javafx.stage.Stage;

      import java.awt.*;

      public class SplashTest extends Application{

      public static void main(String[] args) {
      launch(args);

      }
      public void checkSplashUpdate() {

      SplashScreen splashScreen= java.awt.SplashScreen.getSplashScreen();
      splashScreen.createGraphics();
      splashScreen.update();
      splashScreen.close();
                             // calling splashScreen.update() instead of close() a second time also
                             // kills the app, because internally it also calls SplashLock
      }

      @Override
      public void start(Stage primaryStage) throws Exception {
      checkSplashUpdate();
      }

      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      Didn't found any.

        1. SplashTest.java
          0.8 kB
          Kevin Rushforth
        2. SplashTest.java
          0.7 kB
          Abhijit Roy

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: