JDK-8081375 : sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 8u40
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • Submitted: 2015-05-28
  • Updated: 2017-11-30
  • Resolved: 2017-11-30
Related Reports
Duplicate :  
Description
On Linux OS the user experiences the exception "java.lang.ClassCastException". The call stack of this exception is specified below.

java.lang.ClassCastException: sun.awt.image.BufImgSurfaceData cannot be cast to sun.java2d.xr.XRSurfaceData
  sun.java2d.xr.XRPMBlitLoops.cacheToTmpSurface(XRPMBlitLoops.java:145)
  sun.java2d.xr.XrSwToPMBlit.Blit(XRPMBlitLoops.java:353)
  sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:959)
  sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:577)
  sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:67)
  sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1014)
  sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3318)
  sun.awt.image.ImageRepresentation.drawToBufImage(ImageRepresentation.java:813)
  sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1021)
  sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3318)
  sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3296)
  jx.s.ImageIcon.paintIcon(ImageIcon.java:425)
  jx.s.plaf.IconUIResource.paintIcon(IconUIResource.java:72)
  jx.s.plaf.basic.BasicButtonUI.paintIcon(BasicButtonUI.java:292)
  jx.s.plaf.basic.BasicButtonUI.paint(BasicButtonUI.java:216)
  o.javatools.ui.plaf.IconicButtonUI.paint(IconicButtonUI.java:181)
  com.jgoodies.looks.plastic.PlasticButtonUI.update(PlasticButtonUI.java:91)
  jx.s.JComponent.paintComponent(JComponent.java:780)
  o.i.controls.ToolButton.paintComponent(ToolButton.java:422)
  jx.s.JComponent.paint(JComponent.java:1056)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  org.netbeans.core.windows.view.ui.toolbars.ToolbarContainer.paint(ToolbarContainer.java:327)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  org.netbeans.core.windows.view.ui.MainWindow$1.paint(MainWindow.java:189)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JLayeredPane.paint(JLayeredPane.java:586)
  jx.s.JComponent.paintChildren(JComponent.java:889)
  jx.s.JComponent.paint(JComponent.java:1065)
  jx.s.JComponent.paintToOffscreen(JComponent.java:5219)
  jx.s.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:290)
  jx.s.RepaintManager.paint(RepaintManager.java:1265)
  jx.s.JComponent._paintImmediately(JComponent.java:5167)
  jx.s.JComponent.paintImmediately(JComponent.java:4978)
  jx.s.RepaintManager$4.run(RepaintManager.java:824)
  jx.s.RepaintManager$4.run(RepaintManager.java:807)
  j.security.AccessController.doPrivileged(Native Method)
  j.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
  jx.s.RepaintManager.paintDirtyRegions(RepaintManager.java:807)
  jx.s.RepaintManager.paintDirtyRegions(RepaintManager.java:782)
  jx.s.RepaintManager.prePaintDirtyRegions(RepaintManager.java:731)
  jx.s.RepaintManager.access$1300(RepaintManager.java:64)
  jx.s.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1720)
  j.a.event.InvocationEvent.dispatch(InvocationEvent.java:311)
  j.a.EventQueue.dispatchEventImpl(EventQueue.java:749)
  j.a.EventQueue.access$500(EventQueue.java:97)
  j.a.EventQueue$3.run(EventQueue.java:702)
  j.a.EventQueue$3.run(EventQueue.java:696)
  j.security.AccessController.doPrivileged(Native Method)
  j.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
  j.a.EventQueue.dispatchEvent(EventQueue.java:719)
  o.javatools.internal.ui.EventQueueWrapper._dispatchEvent(EventQueueWrapper.java:169)
  o.javatools.internal.ui.EventQueueWrapper.dispatchEvent(EventQueueWrapper.java:151)
  j.a.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
  j.a.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
  j.a.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
  j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
  j.a.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
  j.a.EventDispatchThread.run(EventDispatchThread.java:82) 
Comments
In VirtualBox virtual machine with 64-bit Oracle Enterprise Linux (OEL) 6.6 OS: 1. Was able to reproduce throwing of the exception with a very similar call stack by means of "SwingSet2" demo application and "steps to reproduce" specified below with JDK 8u152 b16 x64, 64-bit JDK 8 compiled from the latest version of the source code in "jdk8u-dev" forest. 2. Verified that the fix for JDK-8147542 resolves the described in the point #1 exception in JDK 8. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 1. Make sure that Linux OS is used to reproduce the issue. 2. Launch "SwingSet2" demo application from JDK demos and samples package with a JDK to be tested. 3. Change resolution of the screen using the OS system settings. 4. Move the window of "SwingSet2" demo application using mouse or move the mouse pointer over the toolbar in the window of "SwingSet2" demo application. The bug is reproduced, if the exceptions "java.lang.ClassCastException" reported in the main bug occur and are printed in the terminal, from where the demo application was launched. Ported the fix for JDK-8147542 to JDK 8. Closing the bug as a duplicate of JDK-8147542.
30-11-2017

Although the exception experienced by the user looks similar to the exception reported in the bug JDK-7172749, call stacks of both exceptions are not identical. And it looks that the fix created for JDK-7172749 and available from JDK 8u112 b01, most probably does not resolve this bug. I was able to identify the bug, which has the identical end of the exception call stack, it is JDK-8170973. This bug is closed as a duplicate of the bug JDK-8147542, which is resolved in JDK 9 b131, but is not ported to JDK 8. Therefore currently I suppose that this bug is a duplicate of JDK-8147542 and to resolve this bug in JDK 8, it is necessary to back port the fix for JDK-8147542 to JDK 8. Based on the above conclusion, reopening the bug until JDK-8147542 is ported to JDK 8 and unbinding this bug from the bug JDK-7172749.
27-11-2017