United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6370565 : IE browser hangs when multiple applets are reloaded several times

Details
Type:
Bug
Submit Date:
2006-01-10
Status:
Resolved
Updated Date:
2011-02-28
Project Name:
JDK
Resolved Date:
2006-02-21
Component:
deploy
OS:
windows_xp,windows_2000
Sub-Component:
plugin
CPU:
x86,other
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.4.2,1.4.2_12,5.0u4
Fixed Versions:
1.4.2_12 (b01)

Related Reports
Backport:
Backport:
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
Reloading multiple applets continously causes IE to hang.

Details for the Bug:
1. Browser: IE6.0 
2. OS: Windows XP/Windows 2000

To reproduce this bug, have a page having multiple applets and try to reload several times. You will witness a hung IE browser with in minutes. The thread dump seems to suggest the plugin is waiting for the disposal of previouslt loaded applets. Bug is also reproducible in Tiger.
This bug is specific about a hang scenario that the plugin main thread is waiting for a native platform signal that never arrives. The signal is supposed to set when the Java level embedded frame is closed.

The main thread is responsible to create and close the activeX components in IE browser. Blocking main thread causes the browser window unresponsive.

The right synchronization has to be implemented to make sure the main thread is signaled before the applet's thread group is disposed.

                                    

Comments
EVALUATION

There is a racing condition in plugin's diposing applets.

AppletViewer starts a new thread to stop/destroy/quit applet. The thread disposes applet's
threadgroup including the applet's Event Dispatcher Thread (EDT)

The main thread is waiting for the embeded frame's destroy() to complete. The embedded
frame calls windowClosing on the applet's EDT.

The racing between the two threads (disposing applet's thread group and windowClosing
on the EDT) can cause browser hang when the EDT is stopped before the windowClosing is
called.

To address this problem, I make the sendEvent(APPLET_QUIT) call (this call is to dispose
the applet's threadgroup) to wait for signals from embedded frame.destroy().
                                     
2006-01-10
EVALUATION

Planning to forward port all the changes in build 2 of 5.0u7 also. Hao has raised the code review request for the same. Once approved I will putback all the changes.
                                     
2006-02-02



Hardware and Software, Engineered to Work Together