Closed
Bug 1272122
Opened 9 years ago
Closed 9 years ago
Applet that uses the JFileChooser hangs/crashes intermittently on FireFox 42 or higher (46.0.1)
Categories
(Core Graveyard :: Plug-ins, defect, P2)
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: andychoi, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160502172042
Steps to reproduce:
1. Create an applet with a public method that opens javax.swing.JFileChooser.
2. Create an HTML page that loads the applet and a button to call the public method.
3. Deploy the applet and the HTML page to a web server.
4. Load the HTML page via the web server.
5. Click on the button to open JFileChooser once the applet is loaded.
6. Close JFileChooser and repeat 5 if the problem doesn't occur.
7. Close FireFox and repeat 4-6 if the problem doesn't occur.
A zip file that contains an applet JAR file, an applet Java source file, and an HTML page is attached.
The applet JAR file will need to be self-signed before it can be used.
I found a bug that seems to be the same problem but I'm entering a new one as it was entered in 2008 and is currently closed.
https://bugzilla.mozilla.org/show_bug.cgi?id=446005
Please let me know how we can re-open if 446005 should be used instead.
Actual results:
The file chooser is opened hanging intermittently and the Java plug-in crashes if the chooser is left open while hanging.
Expected results:
The file chooser is opened without hanging or crashing.
Severity: normal → major
OS: Unspecified → Windows 7
Priority: -- → P2
Hardware: Unspecified → x86_64
I tried a fresh profile and a workaround (Java 8 update 66 and dom.ipc.plugins.java.enabled set to false) mentioned in following bug but they didn't help.
https://bugzilla.mozilla.org/show_bug.cgi?id=1224549
Hi Andy,
I have tested your issue on latest FF release (46.0.1) and latest Nightly build and could not reproduce it. I have installed Xampp and opened from localhost the testcase you provided in comment 0. The "Browse File" button does not work, and if I click the "Create Applet" button, it throws an error(see attachment).
Is this still reproducible on your end ? If yes, can you please retest this using latest FF release and latest Nightly build (https://nightly.mozilla.org/) and report back the results ? When doing this, please use safe mode, to eliminate custom settings as a possible cause (https://goo.gl/PNe90E).
Thanks,
Paul.
Flags: needinfo?(andychoi)
Hi Paul,
Here is the HTML tag it uses to load the applet.
<applet code="sample/SampleApplet.class" codebase="" archive="SampleApplet.jar" mayscript="true" />
Can you check if you can load the JAR file, SampleApplet.jar, from the browser (http://localhost/SampleApplet.jar) to verify the path is correct and update the path in the SampleApplet.html file if not?
You'll also need to self-sign the applet. Have you done that?
Thanks,
Andy
Can see same issue.
FF is 45.1.0 ESR.
Using JRE 1.8.0_71-b15.
Applet is signed by our infrastructure managers (so not sure that I will be able to give some info about that).
Actual result is the same as mentioned in issue description.
Do we have any update on this issue?
Thanks,
Andy
Flags: needinfo?(andychoi)
Made some investigation and that's what I've found:
1) Applet does not crash, actually;
2) Similar usecase does not fail, if file chooser creation event is fired by applet itself;
3) Some kind of "bad practice" workaround - try to set Firefox's option dom.ipc.plugins.hangUITimeoutSecs to some big value;
And here are details:
1) Applet does not crash actually.
Instead of that, Java plugin hangs. Not FF, not applet.
This happens because of how file chooser works: after file chooser is opened, caller starts waiting for response: selected file or "Cancel was pressed".
In provided usecase, JS waits for file chooser response. If no answer was got after some timeout - then popup "plugin became unresponsive" is displayed. At the same time, while JS is waiting and we are seeing "plugin became unresponsive" popup, file chooser still works: you can navigate on file system, select files, hit "Cancel", etc. The only trick - file chooser's window becomes overlapped by FF window (which displays "plugin became unresponsive" popup). We still see file chooser only because of not re-rendered FF window.
How to check this:
- open test page where button that opens file chooser is;
- make FF window NOT maximized - need to see desktop. We'll move file chooser to that "free of FireFox" area;
- hit button to open file chooser;
- move file chooser out of FF window. THEY SHOULD NOT OVERLAP (this is important). By default you have only 11 seconds for that action in FF 45.1.0 ESR. While dragging the file chooser please note, that FF window is not refreshed - some parts of file chooser "stay" on FF window. After that "plugin is unresponsive" popup will be displayed and you'll have to start over;
- wait for "plugin became unresponsive" popup is displayed;
- try to select files or hit "cancel";
Result - File chooser will close, after it's closed - "plugin unresponsive" popup will hide and FF will be still working.
2) Similar usecase does not fail, if JFileChooser creation is triggered by applet itself;
Filechooser may work if applet will be refactored in the following way:
- move components which call file chooser into applet (in our case - create button not on html page, but in applet's code);
- add click handler to this component;
- create file chooser inside of that handler. Do not make any JS calls.
This allows not to block FF and no messages about unresponsive plugin will be displayed.
You may check that file chooser does not block FF: if you drag it - FF window WILL BE re-rendered (NO "parts" of file chooser will be on it).
3) Some kind of "bad practice" workaround - try to set Firefox's option dom.ipc.plugins.hangUITimeoutSecs to some big value;
"Plugin is unresponsive" popup is displayed after some time, during which plugin "hangs"(in provided usecase plugin hangs while waiting for file chooser response). You can increase this timeout value by setting value of dom.ipc.plugins.hangUITimeoutSecs option. You'll be able to work with file chooser during your timeout.
To set this option:
- go to FF;
- type "about:config" (no quotes) in address bar and hit "I'll be careful, I promise!" button on displayed window;
- find dom.ipc.plugins.hangUITimeoutSecs property using filter;
- default value is 11 - this is timeout in seconds during which FF will not think that plugin became unresponsive;
- set any value you need.
You have to remember, that this is a timeout for all plugins (java, flash, etc.). There are may be some unpleasant effects. So this is not the best way to solve the issue.
Thanks for taking time to investigate this issue but I'm afraid you may not have seen the hanging issue yet since FF and the file chooser won't be responding to your clicks whether the "plugin became unresponsive" popup is displayed or not and thus you won't be able to move the file chooser either.
Please note that the hanging issue occurs intermittently and does not happen on FF earlier than 42.
Based on your explanation, it seems the caller/JavaScript is not getting a response back sometimes causing it to hang. Does this sound right?
I'm thinking FF might need to get involved in fixing this issue as this doesn't seem to be occurring on FF earlier than 42.
Would this be something that Oracle would need to work on?
Thanks,
Andy
Well, I see the hanging issue for our code. Being honest, I did not try to launch your example, but initial state of things is almost the same.
In my case applet/plugin/FF did not hang immediately: file chooser was full of life for 11 seconds (default plugin timeout for FF 45.1.0 ESR), after that - "plugin unresponsive" popup appeared.
As I got - in your case everything collapses at the moment file chooser is displayed, right?
>> Based on your explanation, it seems the caller/JavaScript is not getting a response back sometimes causing it to hang. Does this sound right?
Yes, that was my idea. And in a case if applet's public method is called - browser will be the caller. And it will wait for file chooser's response not more than timeout is.
At the moment I'm not sure who should fix that - Oracle team (via improving Java plugin for FF) or FF team. Changes of both Java and FF may bring things messy... But as for me - I think that it is a problem of file chooser, which hold's caller execution for the time untill some file is not chosen or file chooser is not closed by "Cancel" click.
When it hangs, it hangs immediately and FF and the file chooser freeze/hang and become unresponsive.
It sometimes comes back after ~30 seconds or so but other times continues to hang until you choose to stop/crash the plug-in using the "plugin became unresponsive" popup.
Comment 10•9 years ago
|
||
Andy, why do you extend your SampleApplet from Applet, not from JApplet?
Java Tutorial says that applets which use Swing components should extend JApplet:
>> Swing provides a special subclass of the Applet class called javax.swing.JApplet. The JApplet class should be used for all applets that use Swing components to construct their graphical user interfaces (GUIs).
We extend JApplet, may be that is the reason of different behavior in our cases?
Reporter | ||
Comment 11•9 years ago
|
||
I see the same issue with JApplet also.
Comment 12•9 years ago
|
||
I have also tried to reproduce the issue, however after setting up the environment, I haven't yet managed to self-sign the applet. I'll try to solve this and come back with more results in the next days.
Comment 13•9 years ago
|
||
I have extracted the SampleApplet.zip into a localhost directory, compiled and finaly managed to self-sign the applet. But sadly, after loading the SampleApplet.html in the browser and clicking on "Create Applet" button, a thumbnail with the message "Error. Click for details" is displayed and the alert "ClassNotFoundException" is throwed. You can observe a screenshot of the error in the attachment 8753773 [details].
I have tried this a few times but haven't managed to reproduce the hang. However, since you guys can both reproduce it. I am assigning a component to this issue in order to involve the development team and get an opinion on this.
Component: Untriaged → Plug-ins
Product: Firefox → Core
Comment 14•9 years ago
|
||
There is a known bug in the Java plugin where it doesn't spin the event loop properly when it shows modal dialogs (such as JFileChooser). This causes Firefox to stop responding and ends up killing the Java plugin after a bit.
This bug was exposed when we moved Java out of the main Firefox process for stability and security reasons. We are not willing to undo that change, so any fix here will have to come from Java.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Updated•3 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•