United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6644181 Fail more gracefully if bootstrapping fails
JDK-6644181 : Fail more gracefully if bootstrapping fails

Details
Type:
Bug
Submit Date:
2007-12-20
Status:
Closed
Updated Date:
2010-09-08
Project Name:
JDK
Resolved Date:
2008-03-25
Component:
deploy
OS:
windows_2003,generic,windows_xp,windows_2000
Sub-Component:
plugin
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
beta,6u10
Fixed Versions:
6u10 (b12)

Related Reports
Duplicate:
Relates:

Sub Tasks

Description
6643773 highlighted the fact that if the new plug-in's low level bootstrapping code fails, the current behavior is very poor: it crashes the web browser. Asserts are in place for debug builds, but these are not present in product builds, so we will typically dereference a NULL pointer in C++ code and crash.

Error checking should be added to the product builds so that the only user-visible side effect is perhaps a dialog box and a failure to render the applet. Specifically, explicit error checking needs to be added for at least the following situations:
  - The JVM fails to initialize, and therefore JavaVM_GetJNIEnv() returns NULL early on in the new plug-in's code.
  - Initialization of the JNI method IDs for the IExplorerPlugin, MozillaPlugin and AbstractPlugin Java classes fails for any reason.
  - Instantiation of the Java-side IExplorerPlugin or MozillaPlugin objects fails.

Creation of for example our ActiveX control should simply return with an error, possibly raising a message box dialog. It should not crash.

                                    

Comments
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/deployment_data/6u10/6644181.0
                                     
2008-01-18
EVALUATION

Added needed checks to avoid crashing product build if initialization
of either the JVM or the new plug-in's Java-side classes fails, which
can happen if the Java Kernel's download dialog is cancelled by the
end user during startup of the plug-in.

Tested with manual failure injection at a couple of different levels
in both the IE and Firefox plugins. No other regression test feasible.
                                     
2008-01-18



Hardware and Software, Engineered to Work Together