JDK-8021383 : [mac] When many applets on page not all of them are loaded
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 7u25
  • Priority: P3
  • Status: Resolved
  • Resolution: Won't Fix
  • OS: os_x
  • Submitted: 2013-07-24
  • Updated: 2014-12-18
  • Resolved: 2014-09-26
Related Reports
Blocks :  
Blocks :  
Blocks :  
Blocks :  
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
1.7.0_25-b15 Java HotSpot(TM) 64-Bit Server VM

ADDITIONAL OS VERSION INFORMATION :
Mac OS X 10.8.4 (12E55)

EXTRA RELEVANT SYSTEM CONFIGURATION :
Both, Safari and Firefox, exhibit the same bug.

A DESCRIPTION OF THE PROBLEM :
In a single web page, there are mutiple similiar applets which communicate to each other right after start-up. The applets use the same common jar-file path.

Prior to any user interaction, the applets throw exceptions and freeze. The probability increases with number of applets and approaches 100% with about 10 applets or more.

This worked before at 1.4, 1.5 and 1.6 (with even hundreds of applets in one page) and stopped working with the first release of 1.7.

Please inspect code and fix.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The bug appears in code and on a web site which is our customer's property. We cannot share.

However, there are mutiple similiar applets within one page which communicate to each other right after start-up sharing a common jar-file path. So, it may be a situation not well covered by unit tests. The error becomes deterministic starting at around 10 applets and is sporadic with fewer applets. The bug freezes the JVM *and* destabilizes the browser despite being an external process. The exception typically comes from several of the applets and is before any user intervention happens. The applet tags are written by JavaScript into the html page.

It should be able to trace the cause by looking at the stack trace and inspecting code to figure out why the object could be null. The least measure would be to catch the exception rather than let the applet crash (note that there is none of our code involved in the stack trace, so we cannot catch the exception ourself).

We reported the bug for an earlier release of Java 7 already. Oracle came back to us asking how to repeat it. As I said, this can't be done. Inspect the code, please.

This is a REGRESSION bug vs. Java 1.6.

The stack trace is added as text in field  " Error Message(s): " 

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Applet startup w/o crash
ACTUAL -
Applet crashing its JVM

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Exception in thread  " AWT-EventQueue-2 "  java.lang.NullPointerException
at sun.lwawt.macosx.CEmbeddedFrame.getLayerPtr(CEmbeddedFrame.java:65)
at sun.plugin2.main.client.PluginEmbeddedFrame.setBounds(Unknown Source)
at java.awt.Component.resize(Component.java:2166)
at java.awt.Component.setSize(Component.java:2155)
at java.awt.Window.setSize(Window.java:908)
at com.sun.deploy.uitoolkit.impl.awt.AWTFrameWindow$1.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)


REPRODUCIBILITY :
This bug can be reproduced often.

CUSTOMER SUBMITTED WORKAROUND :
none
The customer (a Chemical Corporation) ceased to roll out Java 7.

SUPPORT :
YES
Comments
This is the cumulative bug for smaller issues (see 'depends on'). Since not all of them has been fixed, closing this as 'Won't fix'
26-09-2014

Filed 4 separate bugs (see 'blocked by' list)
15-05-2014

After fixing this, things became better in sandboxed mode. Though 1-2 applets are still not loaded almost each iteration on the page with 20 applets. Found some exceptions: java.lang.InterruptedException at java.lang.Object.wait(Native Method) at sun.plugin2.message.Queue.waitForMessage(Unknown Source) at sun.plugin2.message.Pipe$1.run(Unknown Source) at com.sun.deploy.util.Waiter$1.wait(Unknown Source) at com.sun.deploy.util.Waiter.runAndWait(Unknown Source) at sun.plugin2.message.Pipe.receive(Unknown Source) at sun.plugin2.main.server.JVMInstance$WorkerThread.run(Unknown Source) Investigating...
06-05-2014

The problem #3 evaluation: actually the applet is successfully started, it's paint() method is executed and it then normally receives all the events, but if the applet content is static and no repaint happens any more we may see that frozen 'progress ring'. If any repaint happens later the applet becomes completely visible and functions normally.
23-04-2014

I observed 3 problems and they appeared to be unrelated to each other: 1. The NPE when applet relaunches: we have a fix for this and this problem has only a cosmetic effect 2. [CEmbeddedFrame-1.png Green asterisk] (happened more frequently) Some applets didn't even tried to start since their native plugin part was incorrectly initialized (the problem described above). I tried a simple fix and now I could intermittently see only the 3rd kind of problems 3. [CEmbeddedFrame-1.png Red asterisk] (happened less frequently) Applet is started (or tries to start) but hangs in process. This still need to be investigated.
22-04-2014

In 07/25 Triage meeting for 7u40 - the teams all agreed (DEV/SQE) that this can be deferred to 8.
26-07-2013

How are these applets communicating with one another? Can you provide more details about the interaction between the applets?
26-07-2013

Removing regression as we do not support Java 6 on Mac OS X
26-07-2013