JDK-7179509 : IE/Java Plugin freezes by dynamically creating an applet since Java 7 update 4
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_7
  • CPU: generic,x86
  • Submitted: 2012-06-25
  • Updated: 2014-01-06
  • Resolved: 2012-07-18
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 7 JDK 8
7u6Fixed 8 b48Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b22)
Java HotSpot(TM) Client VM (build 23.0-b21, mixed mode, sharing)

java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b05)
Java HotSpot(TM) Client VM (build 23.1-b03, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
Microsoft Windows [Version 6.1.7601]

EXTRA RELEVANT SYSTEM CONFIGURATION :
Internet Explorer 7, 8, 9.

A DESCRIPTION OF THE PROBLEM :
When creating an applet dynamically in Internet Explorer (e.g. by Javascript in an html page) by using the <applet> tag the 1st time the applet is loaded the applet and browser are working fine. If one reloads this page and loads the applet a 2nd time the browser or Java Plugin freezes. The only solution in this case is to kill the browser process.

This behavior only depends on the usage of the applet html tag. If you use e.g <object> the browser / plugin will not freeze.

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. ) Load html page wich dynamically creates an applet
2.) 1st time the applet is loaded successfully
3.) Press F5 in Internet Explorer to reload the page
4.) Load the applet a 2nd time


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Java Applet is loaded correctly and is ready to work with.
ACTUAL -
Browser / Java Plugin freezes.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
basic: Applet initialized
basic: Starting applet
basic: completed perf rollup
basic: Applet made visible
basic: Applet started
basic: Told clients applet is started
basic: Starting applet teardown
basic: Finished applet teardown
basic: Fortschritts-Listener entfernt: sun.plugin.util.ProgressMonitorAdapter@1bdbf51
plugin2manager.parentwindowDispose

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Compile this small class

import java.applet.Applet;
import java.awt.Graphics;
 
public class HelloWorldApplet extends Applet
{ 
  public void paint( Graphics graphic )
  {
    graphic.drawString( "Hello World!", 50, 25 );
  }
}

Then use this html page in IE. To load the applet press the button "Create Applet".
<!DOCTYPE html>
<html>
	<head>
		<script src="http://code.jquery.com/jquery-latest.js"></script>
		<script type="text/javascript">
		
			$(document).ready(function () {
				$('#button').click(function () {
					$.ajax({
						url: './applet.html',
						success: function(data) {
							$('#cave').html(data);
						}
					});
				});
			});
		</script>
	</head>
	<body>
		<button id="button" type="button">Create Applet</button>
		<div id="cave" width="220" height="120">
		</div>
	</body>
</html>



---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
1.) Do not install Java 7  update 4+
2.) Do use <object> Tag instead of <applet>

Comments
Verified ok with jdk8 b118, using test class/html in the bug report.
06-01-2014

EVALUATION On page reload, same instance of cAxControl and hence IExplorerPlugin can be reused by IE. Therefore, we need to reset the object state to allow the next applet to start (when we destroy previous instance). All calls are executed on the same thread, so race condition is not possible here. Fix is to reset the gotInitialSize boolean and empty the runnable queue. The invokeLater method checks if the runnable queue is empty before calling into native to process the maybeStartApplet() call.
12-07-2012

EVALUATION When the hang occurs, the client vm is in the process of destroying thread group and AppContext. Applet2Manager executing destroyTGAndAC() for entry file:/C:/Bugs/7179509/ The browser vm is processing SetObjectRects which involves sending a message to the client vm but the client vm was busy doing the above operation.
02-07-2012

WORK AROUND Use <object>tag instead of <applet> tag.
02-07-2012