JDK-8113687 : MediaSystemTest benchmarks throws "IllegalStateException: The view has already been closed" with j2d pipeline
  • Type: Bug
  • Component: javafx
  • Sub-Component: media
  • Affected Version: fx2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2011-06-01
  • Updated: 2015-06-16
  • Resolved: 2011-08-03
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.
Other
fx2.0Resolved
Related Reports
Duplicate :  
Relates :  
Description
MediaSystemTest benchmarks throws "IllegalStateException: The view has already been closed" when running with j2d pipeline.
The exception seems to be thrown after warmup phase is completed:
# Unit: mediasystemtest.bm.MediaSystemBenchmark
# Starting run at: Mon May 30 23:05:38 PDT 2011
# Running a timed run.
# Duration (per iteration): 180s
# Warmup: 15s
# Iterations: 3
# Threads: 1
*** Fallback to Prism SW pipeline
JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
<Doing warmup>
<Running testFXBenchmark (15s)>
fileName: file:///C:/aurora/benchmarks2-resources/media/big_bunny_vp6_1280x720_3710kb_128kb_30p.flv
numOfPlayers: 1
visual bounds - Rectangle2D [minX = 0.0, minY=0.0, maxX=1280.0, maxY=990.0, width=1280.0, height=990.0]
FXBenchmarkGlue: warming up for 15000 ms
startWarmup()
FXBenchmarkGlue: warmup complete
stopWarmup()
java.lang.IllegalStateException: The view has already been closed
at com.sun.glass.ui.View.checkNotClosed(View.java:138)
at com.sun.glass.ui.View.uploadPixels(View.java:363)
at com.sun.prism.j2d.J2DPresentable$Glass$1.run(J2DPresentable.java:84)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29)
at com.sun.glass.ui.win.WinApplication$1$1.run(WinApplication.java:49)
at java.lang.Thread.run(Unknown Source)


Steps to run benchmark:
> download and unzip
   http://jfx.sfbay.sun.com/hudson/job/presidio/171/label=windows-i586-14/artifact/artifacts/sdk/*zip*/sdk.zip
   http://jfx.sfbay.sun.com/hudson/job/presidio/171/label=windows-i586-14/artifact/artifacts/perf/*zip*/perf.zip

> java -client -Xmx256m -Dprism.order=j2d -Djava.library.path="./perf/lib/win32" 
  -cp "./rt/lib/jfxrt.jar;./perf/
  jrockit.bm.Main mediasystemtest.bm.MediaSystemBenchmark -i 3 -wt 15 -tr 180 -players 1 
  -file file:///C:/media/big_bunny_vp6_320x180_360kb_64kb_24p.flv

  media file can be downloaded from http://reavers.us.oracle.com/MediaSystemTest/

The issue is reproduced with latest promoted fx2.0-b30 (hudson build #171)
and is observed with both hardware and software pipelines.
The video is not really shown, just black box.


Comments
This is a duplicate of RT-13589 which needs to be fixed either in the J2DPipeline or more likely in Glass itself.
03-08-2011

OK, I just didn't wait long enough. After running the test all the way through I now see: [java] java.lang.IllegalStateException: The view has already been closed [java] at com.sun.glass.ui.View.checkNotClosed(View.java:142) [java] at com.sun.glass.ui.View.uploadPixels(View.java:358) [java] at com.sun.prism.j2d.J2DPresentable$Glass$1.run(J2DPresentable.java:85) [java] at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) [java] at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29) [java] at com.sun.glass.ui.win.WinApplication$1$1.run(WinApplication.java:49) [java] at java.lang.Thread.run(Thread.java:662) [java]
03-08-2011

Is this bug still reproducible? I tried several variations of the test and it runs without throwing any exceptions. I verified that it it using the j2d pipeline: run-mediasystem-1080_24p-bm-j2d: [java] # Unit: mediasystemtest.bm.MediaSystemBenchmark [java] # Starting run at: Wed Aug 03 06:39:36 PDT 2011 [java] # Running a timed run. [java] # Duration (per iteration): 300s [java] # Warmup: 30s [java] # Iterations: 2 [java] # Threads: 1 [java] *** Fallback to Prism SW pipeline [java] <Doing warmup> [java] <Running testFXBenchmark (30s)> [java] fileName: file:///c:/Users/kcr/javafx/media/vp6_320x180_360_64_24p.flv [java] numOfPlayers: 1 [java] visual bounds - Rectangle2D [minX = 0.0, minY=0.0, maxX=1920.0, maxY=1032.0, width=1920.0, height=1032.0] [java] FXBenchmarkGlue: warming up for 30000 ms [java] startWarmup() [java] FXBenchmarkGlue: warmup complete [java] stopWarmup()
03-08-2011

I think this issue is not related to media and/or cannot be fixed in media. Most likely it needs to be fixed in Prism and/or Glass. I see following: jfx\tests\performance\MediaSystemTest\src\mediasystemtest\Main.java : stopTest() - Exists jfx\glass\glass-mat\src\com\sun\glass\ui\View.java : close() - Called, because Stage.setVisible(false) jfx\runtime\prism-j2d\src\com\sun\prism\j2d\J2DPresentable.java - present() is called and it triggers exception java.lang.IllegalStateException in View.java that we see. MediaPlayer finally stops. Until MediaPlayer is fully stopped (setOnStopped is called) we will push frames, unless FrameConsumer becomes weak referenced or it is removed by calling removeConsumer() in jfx\media\jfxmedia\src\com\sun\media\jfxmedia\MediaFrameHandler.java. Assuming that present() is triggered by new media frame that we send after view is closed, then Prism should remove FrameConsumer listener if it is no longer needs new frames or Prism should not update pixels in View when it is closed. If present() is triggered by something else (not media related) then it definitely not media issue.
18-06-2011

you need to build native library for FXBenchmark: go to tests/performance/FXBenchmark and run "ant build-native", check that dist directory contains perfcounters.dll
14-06-2011

Tried the most recent instructions and got the result shown below. Please advise. [java] failed warmup: java.lang.UnsatisfiedLinkError: no perfcounters in ja va.library.path [java] at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1738) [java] at java.lang.Runtime.loadLibrary0(Runtime.java:823) [java] at java.lang.System.loadLibrary(System.java:1028) [java] at fx.bm.util.counters.win32.WinCounterAccessor.<clinit>(WinCoun terAccessor.java:8) [java] at fx.bm.util.counters.win32.CpuUsageCounter.<init>(CpuUsageCoun ter.java:23) [java] at fx.bm.util.counters.win32.Win32SystemPerfCounters.<init>(Win3 2SystemPerfCounters.java:42) [java] at fx.bm.util.counters.SystemPerfCountersBuilder.build(SystemPer fCountersBuilder.java:43) [java] at fx.bm.FXBenchmark$6.call(FXBenchmark.java:135) [java] at fx.bm.FXBenchmark$6.call(FXBenchmark.java:132) [java] at fx.bm.util.Helpers$3.run(Helpers.java:109) [java] at com.sun.javafx.application.PlatformImpl$2.run(PlatformImpl.ja va:65) [java] at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) [java] at com.sun.glass.ui.win.WinApplication.access$100(WinApplication .java:29) [java] at com.sun.glass.ui.win.WinApplication$1$1.run(WinApplication.ja va:49) [java] at java.lang.Thread.run(Thread.java:662) [java] Java Result: 1
13-06-2011

Will resume investigation after b31 integration is complete tomorrow.
07-06-2011

Brian, I have updated MediaSystemTest/build.xml to download proper video files and also added run-mediasystem-1080_24p-bm-j2d target to run the test with j2d pipeline. So, to run the test do - download latest graphics-scrum workspace - cd tests/performance/MediaSystemTest - ant - ant run-mediasystem-1080_24p-bm-j2d and you should see IllegalState exception after warmup phase is done. Reassigning the bug back to you.
06-06-2011

The command line given in the issue description appears to be incorrect and some of the command line parameters are not recognized when trying to run this from the NetBeans project.
03-06-2011

Should it be runnable from within the NetBeans project using the same command line args? The NetBeans project version appears to ignore these parameters: "-i 3 -wt 15 -tr 180"
03-06-2011

The benchmark is located in jfx workspace under tests/performance/MediaSystemTest
01-06-2011

Where is the source code for the benchmark?
01-06-2011

raising the priority to Critical as basic functionality doesn't work.
01-06-2011