JDK-6847157 : java.lang.NullPointerException: HDC for component at sun.java2d.loops.Blit.Blit
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u13,8,11,14,15,16
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2009-06-02
  • Updated: 2021-08-17
  • Resolved: 2020-11-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 11 JDK 16 JDK 8 Other
11.0.12-oracleFixed 16 b24Fixed 8u301Fixed openjdk8u312Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
It is random. Unknown way how to reproduce. One report so far. It happens when IDE splash screen is displayed during IDE start - at least i looks like from call stack. Original report is at http://www.netbeans.org/issues/show_bug.cgi?id=165867.

Call stack:
java.lang.NullPointerException: HDC for component
        at sun.java2d.loops.Blit.Blit(Blit.java:0)
        at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:927)
        at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:550)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:54)
        at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:982)
        at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:168)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2979)
        at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2964)
        at org.netbeans.core.startup.Splash$SplashComponent.paint(Splash.java:477)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5082)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4880)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:803)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:694)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Comments
Fix Request (8u) I would like to backport this parity bug to openjdk8u. Patch applies cleanly and new test passed.
09-07-2021

Fix Request (11u) This fixes the intermittent failure and keeps codebases in sync (I see 11.0.12-oracle). Patch applies cleanly to 11u. New test passes both with and without the patch.
27-04-2021

Changeset: 2d6c28db Author: Sergey Bylokhov <serb@openjdk.org> Date: 2020-11-09 06:35:50 +0000 URL: https://github.com/openjdk/jdk/commit/2d6c28db
09-11-2020

An exception occurs when the "broken" surface is used for the frame. The surface became broken when it is created during shutdown JVM when some part of the surface is not initialized properly(HDC = 0). So when we try to draw to this surface immediately after creation it fails.
26-10-2020