United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 7074440 Java plugin fails in java7 on page load/reload in IE9
7074440 : Java plugin fails in java7 on page load/reload in IE9

Details
Type:
Bug
Submit Date:
2011-08-03
Status:
Resolved
Updated Date:
2013-01-08
Project Name:
JDK
Resolved Date:
2011-08-24
Component:
deploy
OS:
windows_7
Sub-Component:
plugin
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7u2

Related Reports
Backport:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]  (Windows 7 SP1, 64bit)

EXTRA RELEVANT SYSTEM CONFIGURATION :
32-bit IE9 and 32-bit Java

A DESCRIPTION OF THE PROBLEM :
Loading a page with an applet will randomly fail to work. From the logfile it looks like the plugin part fails to communicate with the JVM (browser plugin crashed?).

Firefox 4 and 5 did not have this problem on the same machine. Reverting to Java6 makes it work again in IE9. Also tested on Vista/IE8 and there it also works for me.
Was repeatable on a second windows7/IE9 machine.

REGRESSION.  Last worked in version 6u26

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Load/Reload the page a few times (5-10 times max).
Enabling trace/logging seems to make it easier to trigger (looks like a race condition).

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No crash.
ACTUAL -
Browser reports "A problem with this webpage caused Internet Explorer to close and reopen the tab" and reloads the page, or sometimes closes it.
I did have a hs_err_pid*.log file but am unsure if that was from testing this. Removed it but were unable to generate a new one so probably not.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Log started: on, 3 aug 2011 12:26:30 +0200
Detected from bootclasspath: C:\\PROGRA~2\\Java\\jre7\\lib\\deploy.jar
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition value null
security: property package.definition new value com.sun.javaws
security: property package.definition value com.sun.javaws
security: property package.definition new value com.sun.javaws,com.sun.deploy
security: property package.definition value com.sun.javaws,com.sun.deploy
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.access new value sun.,com.sun.xml.internal.ws.,com.sun.xml.internal.bind.,com.sun.imageio.,com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
security: property package.definition value com.sun.javaws,com.sun.deploy,com.sun.jnlp
security: property package.definition new value com.sun.javaws,com.sun.deploy,com.sun.jnlp,org.mozilla.jss
basic: Added progress listener: sun.plugin.util.ProgressMonitorAdapter@b1a0f9
network: Cache entry not found [url: http://10.10.120.126:8080/phoenix/ts/sysreq/aa/, version: null]
network: Cache entry found [url: http://10.10.120.126:8080/phoenix/ts/sysreq/aa/Java7.class, version: null] prevalidated=false/0
network: Connecting http://10.10.120.126:8080/phoenix/ts/sysreq/aa/Java7.class with proxy=DIRECT
network: Connecting http://10.10.120.126:8080/ with proxy=DIRECT
network: ResponseCode for http://10.10.120.126:8080/phoenix/ts/sysreq/aa/Java7.class : 304
network: Encoding for http://10.10.120.126:8080/phoenix/ts/sysreq/aa/Java7.class : null
network: Disconnect connection to http://10.10.120.126:8080/phoenix/ts/sysreq/aa/Java7.class
network: Cache entry not found [url: http://10.10.120.126:8080/phoenix/ts/sysreq/aa/, version: null]
basic: Applet loaded.
basic: Applet resized and added to parent container
basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 448759 us, pluginInit dt 3280525 us, TotalTime: 3729284 us
sysreq - init22 done!
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
plugin2manager.parentwindowDispose
basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@b1a0f9
basic: JVM[id=1]-Heartbeat heartbeat dead, exception. dT=4 seconds.
java.lang.InterruptedException
	at java.lang.Object.wait(Native Method)
	at sun.plugin2.message.Queue.waitForMessage(Unknown Source)
	at sun.plugin2.message.Pipe.receive(Unknown Source)
	at sun.plugin2.main.server.HeartbeatThread.run(Unknown Source)


REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Files available on: http://beta.enlight.net/~puw/java7/java7.html

java7.html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <title>Java 7 Applet Test Page</title>
</head>

<body>

  <applet code="Java7">
  </applet>

</body>
</html>

Java7.java:
import java.applet.*;

public class Java7 extends Applet
{
    public void init()
    {
	System.err.println("sysreq - init22 done!");
    }
}

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

CUSTOMER SUBMITTED WORKAROUND :
Removing the doctype stops the crashes, it changes IE9 to use quirks mode and I guess it does something differently with regard to plugins. This whole thing could be an IE bug.

                                    

Comments
EVALUATION

With IE9, there's a race condition between the startup thread and
the browser main thread calling SetClientSite when the DOCTYPE is
specified in the html page embedding an applet. The crash is due to
an invalid pluginObject was used in AbstractPlugin::getJavaNameSpace
when calling a java method.

Instead of waiting for DONE_START in SetClientSite, this new fix is to store the java name space dispatch id in CJavaDispatch. When the dispatch id is needed to invoke a method, get a property, etc., CJavaDispatch will call AbstractPlugin::javaObjectSetField to fully setup the java name space.

A wrapper CJavaDispatch::GetJavaPluginInstance() has been added. It waits for the DONE_START state before calling CAxControl::getJavaIExplorerPluginInstance to make sure the pluginObject has been initialized.
                                     
2011-08-19
WORK AROUND

Remove the following line in the html file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/html4/loose.dtd">
                                     
2011-08-09
EVALUATION

The crash is in AbstractPlugin::getJavaNameSpace when calling a java method "getJavaNameSpace".

Attached are:
tracing with debug output - IE9_trace.txt
windbg log with call stack - IE9_doctype_crash2.txt
                                     
2011-08-09



Hardware and Software, Engineered to Work Together