-
Bug
-
Resolution: Fixed
-
P3
-
1.2.2
-
kestrel
-
x86
-
windows_95
Name: sg39081 Date: 07/28/99
My application must disable all GUI elements at certain
instances. When I tried to call setEnabled() of my PopupMenu,
it produced the following invalid page fault on Windows 95
using JDK 1.2.2
JAVA caused an invalid page fault in
module AWT.DLL at 0137:5027269f.
Registers:
EAX=00000000 CS=0137 EIP=5027269f EFLGS=00010246
EBX=05c4fce2 SS=013f ESP=05c4fc50 EBP=05c4fc90
ECX=ffffffff DS=013f ESI=00000000 FS=2c9f
EDX=00000000 ES=013f EDI=05c4fc98 GS=2507
Bytes at CS:EIP:
8b 56 2c 0f 94 c0 50 51 52 ff 15 e4 7f 35 50 8b
Stack dump:
00000487 50272779 00000000 50270904 05a0f898 5027c710 05a0f898 05c4fc98
00008d06 05c4fce2 bff74277 bffbf9e0 05c4fc6c 05c4fccc 5032319b 00000000
On Windows 95 using JDK 1.1.8:
JAVA caused an invalid page fault in
module KERNEL32.DLL at 0137:bff9a28c.
Registers:
EAX=c0016f74 CS=0137 EIP=bff9a28c EFLGS=00010202
EBX=022bff84 SS=013f ESP=021bfe80 EBP=021c011c
ECX=00000000 DS=013f ESI=00789950 FS=0d2f
EDX=021c0164 ES=013f EDI=00000000 GS=0000
Bytes at CS:EIP:
53 8b 15 7c c2 fb bf 56 89 4d e4 57 89 4d dc 89
Stack dump:
After tracing and debugging, I was able to find the setEnabled()
line was the problem. After commenting out setEnabled(), the
application worked fine. The following was produced by JDB
right as it crashed:
Breakpoint hit: sun.awt.windows.WMenuItemPeer.enable (WMenuItemPeer:63)
AWT-EventQueue-0[1] AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Fatal exception: java.net.SocketException: Connection reset by peer
java.net.SocketException: Connection reset by peer
at java.net.SocketInputStream.read(Compiled Code)
at java.io.BufferedInputStream.fill(Compiled Code)
at java.io.BufferedInputStream.read(Compiled Code)
at java.io.FilterInputStream.read(FilterInputStream.java:73)
at sun.tools.debug.AgentIn.run(Compiled Code)
at java.lang.Thread.run(Thread.java:466)
The application also has a MenuBar.
The file PaletteBuilder.java contains the code, which I tried to comment for
you so it's easy to find. (It's a simple color palette building program
and I consider it "freeware," so I don't mind sharing the source... if you
can wade through my code.... :)
Here's a description of what new seems to be happening in JDK 1.1.8:
Previously (JDK 1.1.7), when PopupMenu.setEnabled() gets called, JAVA
caused an invalid page fault in WINAWT.DLL (see old message below). In JDK
1.1.8, JAVA just seems to lock up and doesn't do anything. I must end the
task in the task manager to kill the program.
JAVA_G printout to standard error:
Internal error: 0, The operation completed successfully.
..\..\..\..\src\win32\sun\windows\awt_MenuItem.cpp:371 menu != NULL &&
GetID() >= 0
And running it through JDB, I discovered something interesting. It picks
up at PaletteBuilder, line 299 (poppy.setEnabled(true);):
Breakpoint hit: PaletteBuilder.enableGUI (PaletteBuilder:299)
AWT-EventQueue-0[1] step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.setEnabled (MenuItem:181)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:201)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:202)
AWT-EventQueue-0[1] !!
step
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:189)
AWT-EventQueue-0[1] AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:190)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:191)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: java.awt.MenuItem.enable (MenuItem:192)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1]
Breakpoint hit: sun.awt.windows.WMenuItemPeer.enable (WMenuItemPeer:63)
AWT-EventQueue-0[1] !!
step
AWT-EventQueue-0[1] !!
step
Current thread is not suspended.
AWT-EventQueue-0[1] threads
Group PaletteBuilder.main:
1. (java.awt.EventDispatchThread)0xe5cc28 AWT-EventQueue-0 running
2. (java.lang.Thread)0xe5ce18 AWT-Windows running
3. (sun.awt.ScreenUpdater)0xe5e7d0 Screen Updater running
JDB continues to respond, and all threads continue to run... but control
(from the user perspective) appears to hang. As indicated by the last
attempt above, a "step" command results in "Current thread is not
suspended," as it appears a thread (EventDispatchThread 0xe5cc28(?)) is
"stuck" in sun.awt.windows.WMenuItemPeer.enable (WMenuItemPeer line 63).
I've let the program run for some time, and it doesn't seem to recover
unless I kill the process. (Quit command in JDB doesn't work either.)
As stated before, if I simply disable the component under the PopupMenu,
this takes care of my problem. I just thought you guys might want to check
into this, in case someone else runs into the same problem.
File->Open is probably the best place to start to try and recreate the problem.
This is where I consistantly remember seeing it occur. On 1.1.8, it opens the
FileDialog, lets you choose a file, closes the dialog, and then appears to freeze.
Under 1.1.7, after closing the FileDialog, the Windows error message
appears, stating the invalid page fault and closes the application. If the
problem does not appear aftern doing an Open on reds.pal, then try
Edit->Create Range...
While I don't have access to Solaris, I do have the Blackdown.org port to
Linux, which I believe is based on the Solaris distribution. Under 1.1.7,
the application appears to work perfectly, so the problem appears to only
occur in Windows.
The source code is in the attachments.
(Review ID: 52828)
======================================================================