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

NullPointerException in GlassScene.java at line 325

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 8u192, openjfx11
    • Fix Version/s: openjfx14
    • Component/s: javafx
    • Labels:
    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      linux_ubuntu

      Description

      ADDITIONAL SYSTEM INFORMATION :
      java 8u161.
      Ubuntu 16.04.2 64bit


      A DESCRIPTION OF THE PROBLEM :
      2019-02-19 00:25:50,885 [23936] [QuantumRenderer-0] ERROR - java.lang.NullPointerException
      2019-02-19 00:25:50,886 [23936] [QuantumRenderer-0] ERROR - at com.sun.javafx.tk.quantum.GlassScene.frameRendered(GlassScene.java:325)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at com.sun.javafx.tk.quantum.PaintCollector.done(PaintCollector.java:284)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at com.sun.javafx.tk.RenderJob.run(RenderJob.java:77)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:125)
      2019-02-19 00:25:50,887 [23936] [QuantumRenderer-0] ERROR - at java.lang.Thread.run(Thread.java:748)

      I see this has been reported before here:
      https://bugs.openjdk.java.net/browse/JDK-8163360

      but closed as no test case was submitted. I'm not able to submit one either, but have a suggestion on how this could occur by looking at the code in GlassScene.

      There is a null check in the offending method:

          public final synchronized void frameRendered() {
              if (scenePaintListener != null) {
                  scenePaintListener.frameRendered();
              }
          }

      Notice this method is synchronized and dispose, which set's scenePaintListener to null, isn't.

      Therefore I think what has happened here is:

      Thread 1: Null check passes
      Thread 2: dispose() set's to null
      Thread 1: calls method on null reference


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Happened twice, unable to reproduce.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      No crash
      ACTUAL -
      Crash/Stall.

      FREQUENCY : rarely


        Attachments

          Activity

            People

            • Assignee:
              arapte Ambarish Rapte
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: