JDK-8126735 : NullPointerException in PrismMediaFrameHandler with multi-threading enabled
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-08-08
  • Updated: 2015-06-17
  • Resolved: 2012-08-09
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
8Fixed
Related Reports
Blocks :  
Duplicate :  
Description
When running VideoCube I get the following exception intermittently:

java -cp C:/Users/kcr/javafx/3.0-kcr-gfx/jfx/artifacts/sdk/rt/lib/jfxrt.jar;dist/VideoCube.jar videocube.VideoCube
java.lang.NullPointerException
        at com.sun.javafx.sg.prism.PrismMediaFrameHandler$PrismFrameBuffer.<init>(PrismMediaFrameHandler.java:174)
        at com.sun.javafx.sg.prism.PrismMediaFrameHandler.updateTexture(PrismMediaFrameHandler.java:104)
        at com.sun.javafx.sg.prism.PrismMediaFrameHandler.getTexture(PrismMediaFrameHandler.java:85)
        at com.sun.javafx.sg.prism.NGMediaView.renderContent(NGMediaView.java:134)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:358)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:41)
        at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1166)
        at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:223)
        at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:189)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:358)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:41)
        at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1166)
        at com.sun.javafx.sg.prism.NGGroup.renderChildren(NGGroup.java:223)
        at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:189)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:358)
        at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:41)
        at com.sun.javafx.sg.BaseNode.render(BaseNode.java:1166)
        at com.sun.javafx.tk.quantum.ViewPainter.doPaint(ViewPainter.java:128)
        at com.sun.javafx.tk.quantum.AbstractPainter.paintImpl(AbstractPainter.java:190)
        at com.sun.javafx.tk.quantum.PresentingPainter.run(PresentingPainter.java:74)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178)
        at com.sun.prism.render.RenderJob.run(RenderJob.java:37)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:98)
        at java.lang.Thread.run(Thread.java:722)

Comments
No, this is in MediaPlayer. I need to synchronize access to a private field.
08-08-2012

If it turns out to be in the graphics stack, please reassign.
08-08-2012

The NPE is happening in the following code: public PrismFrameBuffer(VideoDataBuffer sourceBuffer) { if (null == sourceBuffer) { throw new NullPointerException(); } master = sourceBuffer; switch (master.getFormat()) { ^^^^^^^^^^^^^^^^^^^^^^^^^^ I verified that getFormat() is returning a null enum which causes the switch statement to throw an NPE. It seems likely that the VideoDataBuffer is not being modified in an MT safe manner.
08-08-2012

These problems if I am not mistaken occur because of changes in the graphics stack, not in the media stack per se. So although they are related to rendering media, I am not convinced that they are media issues. That said we will plan to do the initial due diligence.
08-08-2012

This probably has the same root cause as RT-24061 as both that crash and this NPE happen in PrismMediaFrameHandler in updateTexture
08-08-2012