| Summary: | Empty Shells in Eclipse | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Johannes Rieken <johannes_rieken> | ||||||||||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||||||||||
| Status: | CLOSED DUPLICATE | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | adam, eclipse.felipe, lshanmug, patrick, remy.suen, Silenio_Quarti | ||||||||||||
| Version: | 3.7 | ||||||||||||||
| Target Milestone: | --- | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Johannes Rieken
Created attachment 202677 [details]
capture 1
Created attachment 202678 [details]
capture 2
what version of mac os x are you running ? is that git support that you have installed, anything else ? I see that since I upgraded to Lion (10.7.1). Not git, but Jazz/RTC installed. Just ran into this working with SWT Paperclips - print preview appearing as a blank white rectangle with Lion, worked fine with Snow Leopard. I've been doing some digging and at least in my case it appears the problem is caused by creating a GC with a Printer device.
The GC doesn't need to be used, just created. Here's a snippet that causes the problem on my OS X Lion install:
public class DialogTest {
public static void main(String[] args) {
/* Take this line out and it works */
new GC(new Printer(Printer.getDefaultPrinterData()));
Display display = new Display();
Shell shell = new Shell(display);
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
*** Bug 359316 has been marked as a duplicate of this bug. *** bug 359316 has crash logs that happen after seeing this bug. I've seen it with both 10.6 and 10.7 Silenio, there is a snippet in comment 5, could you please try that on your Lion ? Thanks Lakshmi, do you have Lion installed already ? The problem from comment#5 happens on Lion and Snow Leopard for me. It happens because the sample code is not calling printer.startDoc()/printer.endDoc(), which could be considered an application error. I will attach a patch that solves this problem, but the patch will not be released for now. It requires more testing and I believe this problem is not related to original problem or to the problem in comment#6. Those are probably memory leaks (shells not being disposed properly?). It could be a bug in the application code or in SWT. Johannes, Adam, do you have any other plugins install (which are not in the Eclipse SDK)? Created attachment 204468 [details] patch for problem in comment#5 I have the following: Emma EGit TeamCity Google Suite I also got another crash on saving with a log and exception, I can post that if it would help at all. Btw, I saw this problem before TC plugin, but I don't remember for the others. I run the following snippet on Snow Leopard (the snippet leaks shells). I am able to create 704 shells before I get a blank shell. If I uncomment the line that disposes shells the snippet finishes properly.
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Test356601 {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
for (int i = 0; i < 1000; i++) {
System.err.println(i);
Shell s = new Shell();
s.setVisible(true);
// s.dispose();
}
shell.pack();
shell.open();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
Created attachment 207439 [details]
CrashReport from crash after seeing black shells.
I saw three blank shells for dialogs and then eclipse crashed.
Created attachment 208033 [details]
BadLocationException
I get lots of BadLocationException exceptions in the workspace log before I see the blank dialogs. See attachment.
I am assuming this is happening because of this shell leak. *** This bug has been marked as a duplicate of bug 338975 *** |