Name: rmT116609 Date: 02/20/2003
FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
Creating a popup that becomes hidden when a given component
loses focus will cause a VM crash if the user clicks on the
popup contents.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Compile and run the test case.
2. This will show a frame with a button inside.
3. Press the button in the new frame.
4. This will show a popup that partially covers the button.
5. Resize the frame.
5. Click on the text of the popup.
6. The VM will crash with an EXCEPTION_ACCESS_VIOLATION
EXPECTED VERSUS ACTUAL BEHAVIOR :
Clicking the text of the popup should hide the popup (due
to the focus lost listener on the button)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x0
Function=[Unknown.]
Library=(N/A)
NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.
Current Java thread:
at sun.awt.windows.WToolkit.eventLoop(Native Method)
at sun.awt.windows.WToolkit.run(WToolkit.java:253)
at java.lang.Thread.run(Thread.java:536)
Dynamic libraries:
0x00400000 - 0x00406000 C:\j2sdk1.4.1\bin\javaw.exe
0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
0x77DB0000 - 0x77E0B000 C:\WINNT\system32\ADVAPI32.dll
0x77E80000 - 0x77F35000 C:\WINNT\system32\KERNEL32.DLL
0x77D40000 - 0x77DB0000 C:\WINNT\system32\RPCRT4.DLL
0x77E10000 - 0x77E74000 C:\WINNT\system32\USER32.dll
0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
0x75E60000 - 0x75E7A000 C:\WINNT\System32\IMM32.DLL
0x6CA60000 - 0x6CA68000 C:\WINNT\System32\LPK.DLL
0x66650000 - 0x666A4000 C:\WINNT\System32\USP10.dll
0x6D330000 - 0x6D45A000 C:\j2sdk1.4.1\jre\bin\client\jvm.dll
0x77570000 - 0x775A0000 C:\WINNT\System32\WINMM.dll
0x6D1D0000 - 0x6D1D7000 C:\j2sdk1.4.1\jre\bin\hpi.dll
0x6D300000 - 0x6D30D000 C:\j2sdk1.4.1\jre\bin\verify.dll
0x6D210000 - 0x6D229000 C:\j2sdk1.4.1\jre\bin\java.dll
0x6D320000 - 0x6D32D000 C:\j2sdk1.4.1\jre\bin\zip.dll
0x6D000000 - 0x6D0FB000 C:\j2sdk1.4.1\jre\bin\awt.dll
0x77800000 - 0x7781D000 C:\WINNT\System32\WINSPOOL.DRV
0x77A50000 - 0x77B46000 C:\WINNT\system32\ole32.dll
0x6D180000 - 0x6D1D0000 C:\j2sdk1.4.1\jre\bin\fontmanager.dll
0x51000000 - 0x51044000 C:\WINNT\System32\ddraw.dll
0x728A0000 - 0x728A6000 C:\WINNT\System32\DCIMAN32.dll
0x72D90000 - 0x72E03000 C:\WINNT\System32\D3DIM.DLL
0x6E420000 - 0x6E426000 C:\WINNT\System32\INDICDLL.dll
0x10000000 - 0x10005000 C:\Program Files\Jabber\actMonitor.dll
0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
0x690A0000 - 0x690AB000 C:\WINNT\System32\PSAPI.DLL
Local Time = Thu Feb 20 10:16:57 2003
Elapsed Time = 5
#
# The exception above was detected in native code outside the VM
#
# Java VM: Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode)
#
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.swing.*;
import java.awt.event.*;
public class PopupCrash {
private static Popup popup = null;
public static void main(String[] args) {
JFrame frame = new JFrame();
JPanel root = new JPanel();
final JLabel popupContents = new JLabel("Click to crash VM");
final JButton button = new JButton();
button.setAction(new AbstractAction("Show popup"){
public void actionPerformed(ActionEvent e) {
if (popup == null) {
popup = PopupFactory.getSharedInstance().getPopup(button,
popupContents, button.getLocationOnScreen().x, button.getLocationOnScreen().y);
popup.show();
}
}
});
root.add(button);
button.addFocusListener(new FocusAdapter() {
public void focusLost(FocusEvent e) {
if (!e.isTemporary()) {
if (popup != null) {
popup.hide();
popup = null;
}
}
}
});
//uncomment this to workaround the crash - seems pretty dodgy, but it works
// popupContents.addMouseListener(new MouseAdapter() {
// public void mousePressed(MouseEvent e) {
// if (popup != null) {
// popup.hide();
// popup = null;
// }
// }
// });
frame.getContentPane().add(root);
frame.pack();
frame.show();
}
}
---------- END SOURCE ----------
CUSTOMER WORKAROUND :
add a mouse pressed listener to the popup contents in order
to hide the popup before focus can be transfered to it (see
the commented out lines in the included source code).
(Review ID: 181558)
======================================================================