JDK-6658398 : a regression test MemoryLeakTest threw exceptions.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris
  • CPU: sparc
  • Submitted: 2008-02-01
  • Updated: 2010-04-03
  • Resolved: 2008-03-25
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 6 JDK 7
6u10 b20Fixed 7Fixed
Related Reports
Relates :  
Description
Java Version: 1.6.0_10-ea-b11
Platform: Solaris-Sparc 10
Problem: Running the test MemoryLeakTest with d3d flag, when you max/min the test windows as instruction says, it threw exceptions as below, but it is not always threw.
/net/jre.sfbay/p/v06/jdk/6_10/ea/b11/binaries/solaris-sparc/bin/java -Dsun.java2d.d3d=True MemoryLeakTest
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at MemoryLeak.componentResized(MemoryLeakTest.java:131)
        at java.awt.Component.processComponentEvent(Component.java:5920)
        at java.awt.Component.processEvent(Component.java:5874)
        at java.awt.Container.processEvent(Container.java:2058)
        at java.awt.Window.processEvent(Window.java:1801)
        at java.awt.Component.dispatchEventImpl(Component.java:4466)
        at java.awt.Container.dispatchEventImpl(Container.java:2116)
        at java.awt.Window.dispatchEventImpl(Window.java:2443)
        at java.awt.Component.dispatchEvent(Component.java:4296)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:284)
        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)
MemoryLeakTest Failed.
Exception in thread "main" java.lang.Exception: MemoryLeakTest failed.
        at MemoryLeakTest.main(MemoryLeakTest.java:27)

How to reproduce the problem:
Use 6u10-b11 java which in:
/net/jre.sfbay/p/v06/jdk/6_10/ea/b11/binaries/solaris-sparc
to run the regression test in 
/net/jano1/export1/jcg/ws/6uN/jcg/j2se/test/java/awt/image/MemoryLeakTest

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u10/6658398.0
05-03-2008

EVALUATION I'm afraid this is a defect in the test itself which is due to an undetermined order of ComponentEvents. We can't guarantee anything about it because on different platforms they may come in a different order. If the ComponentShowing event comes first there seem osImage becomes initialized and following componentResized() method addresses non-null value to invoke its method. Othervise we use null value to invoke method. BTW, I'm constantly able to reproduce NPE w/o d3d flag on Windows2000 with JDK6.0.
27-02-2008

EVALUATION At the same time, I don't see any place in specification which prohibits componentResized notifications for invisible components. If such notifications are really acceptable, then the test should be corrected.
26-02-2008

EVALUATION The test has been failing since at least JDK6-b61 (works fine with b46).
26-02-2008

EVALUATION D3D is only present on Windows platform, the test is failing on Solaris so passing this flag has no relevance. This appears to be caused by some changes in AWT (or just the right timing). The "oldimage" which is init-ed to "osImage" can be null only if componentResized event is received before componentShown (where the osImage is initialized). Reassigning to awt.
01-02-2008