| Summary: | Eclipse crash at quit when modal dialog opened | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Zhi Guo Yang <yangzg> | ||||||||
| Component: | SWT | Assignee: | Silenio Quarti <Silenio_Quarti> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Lakshmi P Shanmugam <lshanmug> | ||||||||
| Severity: | blocker | ||||||||||
| Priority: | P3 | CC: | kleind, lshanmug, mukund, pwebster, raji, remy.suen, skovatch | ||||||||
| Version: | 3.5.2 | ||||||||||
| Target Milestone: | 3.7 M6 | ||||||||||
| Hardware: | Macintosh | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Zhi Guo Yang
Created attachment 177904 [details]
Eclipse Crash log file
Eclipse Crash log file
On 3.6 Carbon we don't crash, but you're left with the file chooser dialog open. Canceling that gracefully quits Eclipse. In Cocoa the quit command cancels the file dialog first. Moving to Silenio, since it's Carbon. I believe this is already fixed in 3.6.2. I cannot reproduce the problem with the following build. Please try it out and let me know if you still can reproduce it. http://download.eclipse.org/eclipse/downloads/drops/M20101222-0800/index.php Silenio Can you please confirm if this is fixed with SWT 3.6.2 . We are currently using the RC1 build . I tried the scenario with 3.6.2 RC1 build and cannot reproduce the crash. But, the file dialog is left behind and has to be canceled. Ok, I tried again. In the same scenario, after quiting eclipse, the file dialog was left behind. I didn't cancel it and left it as it is. It crashes after say 1-2 mins. Since this can still be recreated, am requesting that this bug be re-opened. Is this bug related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=336957 ? Lakshmi, please investigate this bug further and see if you can find a solution. I am still not able to reproduce it. I left the FileDialog up for a long time. Eclipse did not crash and as soon as I press the cancel button, eclipse exists normally. (In reply to comment #9) > Is this bug related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=336957 ? It is hard to tell. The stacks are not similar. Here is a simple snippet to reproduce the problem. After quitting with modal dialog open, try to click on another window/application to see the crash happen. Invalid memory access is printed in the console.
import org.eclipse.swt.*;
import org.eclipse.swt.events.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
public class Bug_324155 {
public static void main(String[] args) {
Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
Button button = new Button(shell, SWT.PUSH);
button.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
button.setText("open file dialog");
button.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
FileDialog fd = new FileDialog(shell, SWT.OPEN);
fd.open();
}
});
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Thanks Lakshmi, I can reproduce the problem with your snippet. The problem happens because you are leaving event handlers attached and disposing their callback (appleEventCallback, commandCallback, etc). I am working on a fix. Created attachment 190205 [details]
fix
I released this patch to HEAD. Lakshmi, please try it out.
Fixed > 20110302. (In reply to comment #14) > Created attachment 190205 [details] > fix > > I released this patch to HEAD. Lakshmi, please try it out. In case anyone was confused as I was when looking at the patch, the print statements have been removed. http://dev.eclipse.org/viewcvs/viewvc.cgi/org.eclipse.swt/Eclipse%20SWT/carbon/org/eclipse/swt/widgets/Display.java?r1=1.348&r2=1.349 Can we get a patch for 3.6.2 (or will this patch already apply to 3.6.2)? Created attachment 190304 [details]
patch for 3.6.2
This is the patch for the 3.6.2 branch. Note that it contains changes in the native code, so you need new SWT libraries.
|