JDK-8039081 : [TEST_BUG] Test java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java fails
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 8u20,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-04-02
  • Updated: 2023-10-09
  • Resolved: 2016-08-05
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 9
9 b133Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Testsuite: Regression
Test name: java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java
JDK tested: JDK 8u20 b07
OS tested: Linux 32-bit, Windows 7 64-bit 

Test fails since 8u20 b07 after it was integrated in fix to JDK-8007220. 
It seems that the bug is in the test.

LOG Oracle Linux 32-bit:

java.lang.RuntimeException: Failed, reference to popup not collected
	at PopupMenuLeakTest.assertCollected(PopupMenuLeakTest.java:86)
	at PopupMenuLeakTest.main(PopupMenuLeakTest.java:54)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:744)


LOG Windows 7 x64:

java.lang.reflect.InvocationTargetException
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1300)
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:1275)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1348)
        at PopupMenuLeakTest.main(PopupMenuLeakTest.java:50)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
        at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.IllegalArgumentException: illegal popup menu container class
        at sun.awt.windows.WPopupMenuPeer.<init>(WPopupMenuPeer.java:65)
        at sun.awt.windows.WToolkit.createPopupMenu(WToolkit.java:461)
        at java.awt.PopupMenu.addNotify(PopupMenu.java:124)
        at PopupMenuLeakTest.addNotifyPopup(PopupMenuLeakTest.java:63)
        at PopupMenuLeakTest$$Lambda$2/193086262.run(Unknown Source)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:301)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:744)
        at java.awt.EventQueue.access$400(EventQueue.java:97)
        at java.awt.EventQueue$3.run(EventQueue.java:697)
        at java.awt.EventQueue$3.run(EventQueue.java:691)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:714)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Comments
This depends on JDK-8160974. Please re-add jdk8u-fix-request when JDK-8160974 is in 8u and the 8039081 patch has been rebased. Also, fix requests should include an explanation as to why the backport is needed.
15-12-2020

Review approval: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-November/012989.html
16-11-2020

Fix Request (8u). Review request: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-November/012979.html.
12-11-2020

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/42925c7a35aa User: lana Date: 2016-08-24 21:12:56 +0000
24-08-2016

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/42925c7a35aa User: arapte Date: 2016-08-05 10:18:56 +0000
05-08-2016

Starting from Fixing test bug preferable to get Author role sooner than later
21-08-2015

This is a test bug. THe test was originally written for OS X and uses strange pattern to emulate the memory leak. However this approach does not work on Windows, which is perfectly fine as the test relies on the implementation details. The test should be rewritten and, possibly, converted to a manual test.
08-05-2014