| Summary: | SwtBrowser causes JRE to crash | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Yuhan Zhang <yzhang> | ||||
| Component: | SWT | Assignee: | Grant Gayed <grant_gayed> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | chrriis, remy.suen | ||||
| Version: | 3.6.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Yuhan Zhang
The crash is happening in the event loop, so there is not an obvious hint there. Your use of threads seems unnecessary given the Browser's asynchronous nature though. Can you try each of the following changes in your app:
1. In your second provided code block (starts with "final String url =..."), change the asyncExec()'s Runnable to:
public void run() {
browser.addProgressListener(new ProgressAdapter() {
public void completed(ProgressEvent event) {
browser.setUrl(url); // may hang or crash overtime
browser.removeProgressListener(this);
};
});
browser.setUrl( "about:blank" ); // erase previous content
}
2. Change your third provided code block (starts with "Thread deplayedProcessingThread =...") to:
int maxWait = 10*1000;
display.timerExec(maxWait, new Runnable() {
public void run() {
// this runnable can be cancelled before its timer completes
// by invoking "display.timerExec(-1, this)"
browser.stop();
Object returnValue = browser.evaluate(MY_JAVASCRIPT_WITH_OBJECTS_RETURNED ));
//processing the returnValue...
}
});
3. If these do not help, please try with the eclipse 3.7.1 release ( http://download.eclipse.org/eclipse/downloads/drops/R-3.7.1-201109091335/index.php ). Also, it looks like you are using XULRunner 1.9. It probably would not hurt to try to download a recent XULRunner release such as http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/3.6.24/runtimes/xulrunner-3.6.24.en-US.linux-i686.tar.bz2 , and point at it explicitly as described in the first two paragraphs of http://www.eclipse.org/swt/faq.php#specifyxulrunner . It is possible that the newer XULRunner release may contain a fix for what you are seeing.
It appeared the crashing only happenes with the older jar (org.eclipse.swt.gtk.linux.x86_3.6.2.v3659b.jar). The code starts to work without crashing after swt is upgraded to 3.7.1. |