| Summary: | certain images cause "no more handles" on win7 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Daniel Schaarschmidt <daniel.schaarschmidt> | ||||||||
| Component: | SWT | Assignee: | Carolyn MacLeod <carolynmacleod4> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | b.muskalla, carolynmacleod4, eclipse.felipe, mknauer, Silenio_Quarti | ||||||||
| Version: | 3.7 | ||||||||||
| Target Milestone: | 4.2 M3 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Windows 7 | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Daniel Schaarschmidt
Created attachment 198880 [details]
Stack Trace SWTErrror
Thanks Daniel for the detailled steps but I'm not able to reproduce it with your steps. Tthis problem can always happen in case one of the plugins is leaking resources (eg. images, fonts, ..). I'll use this task to check the resource dispose again for MPC in case we missed it at some point. So in MPC we don't have any leaked resources. Another case I see is that Yoxos returns an unmanageable amount of items and we fail to limit them in some way. As I cannot reproduce this, closing it for now. Daniel, I'd be happy to provide a fix for this but I'm not able to reproduce. If you have any additional hints, that would be great. Interesting to know would be if this happend with Helios or Indigo. I first noticed it with Indigo(x64) but can reproduce it with Helios (x86) on my and my colleagues machines, too. It seems only to happen on our Windows machines (all were Win 7 x64). With OpenSuse 11.4 and Indigo there were no problems at all. Not only searching for "target management" crashes, searching for "management" alone is enough to bring Eclipse down. Ok, I managed to reproduce it on a windows machine. On Linux this does not happen. Will look into it. Thanks Daniel! Ok, essentially: not a MPC problem but an SWT bug. One of the images delivered by the Yoxos marketplace let SWT throw up, image in question is the logo of the Maven plugins: http://market.eclipsesource.com/places/doc/org.maven.ide.eclipse.feature.feature.group/logo.jpg Short fix: Markus, please replace the image in the Yoxos marketplace with something else and test on Win7 Long fix: Over to you SWT, see attached snippets to reproduce. SWT can't read image anyway (neither on Windows nor on Linux) but on Windows 7, using this image and creating it via an *local* url descriptor leads to "No more handles" (url descriptor using http works, read: returns broken image). See attached snippet. Created attachment 201532 [details]
snippet
.
Created attachment 201533 [details]
logo.jpg
problematic image
Silenio, the pixel format for the problematic image is PixelFormat32bppCMYK.
Note that we failed to load this image with the native loader:
Image image = new Image(display, "logo.jpg");
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4309)
at org.eclipse.swt.SWT.error(SWT.java:4198)
at org.eclipse.swt.SWT.error(SWT.java:4169)
at org.eclipse.swt.graphics.Image.initNative(Image.java:752)
at org.eclipse.swt.graphics.Image.<init>(Image.java:579)
at Leak.main(Leak.java:31)
Image image = new Image(display, new ImageData("logo.jpg"));
and the java loader:
Exception in thread "main" org.eclipse.swt.SWTException: Invalid image
at org.eclipse.swt.SWT.error(SWT.java:4283)
at org.eclipse.swt.SWT.error(SWT.java:4198)
at org.eclipse.swt.SWT.error(SWT.java:4169)
at org.eclipse.swt.internal.image.JPEGDecoder.error(JPEGDecoder.java:2259)
at org.eclipse.swt.internal.image.JPEGDecoder.loadFromByteStream(JPEGDecoder.java:6321)
at org.eclipse.swt.internal.image.JPEGFileFormat.loadFromByteStream(JPEGFileFormat.java:1383)
at org.eclipse.swt.internal.image.FileFormat.loadFromStream(FileFormat.java:48)
at org.eclipse.swt.internal.image.FileFormat.load(FileFormat.java:84)
at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:130)
at org.eclipse.swt.graphics.ImageLoader.load(ImageLoader.java:157)
at org.eclipse.swt.graphics.ImageDataLoader.load(ImageDataLoader.java:26)
at org.eclipse.swt.graphics.ImageData.<init>(ImageData.java:377)
at Leak.main(Leak.java:32)
Ben, your best workaround is to convert this image to some other pixel format (like RGBA, etc). Just FYI, this is a broken image in IE8, and the colors load incorrectly under Quicktime. So you will definitely want to switch to a more common pixel format. Leaving this bug open to one day add support for PixelFormat32bppCMYK. Changing bug type to 'enhancement'. I think the "bug" in this case is still valid to throw the same errors on all operating systems. Yes, I suppose we shouldn't crash if we get an unhandled pixel format... ;) SSQ, maybe I should just set the error to Invalid Image for all unknown pixel formats? Looking at the code, I don't think it truly ran out of handles. (In reply to comment #13) > Yes, I suppose we shouldn't crash if we get an unhandled pixel format... ;) > SSQ, maybe I should just set the error to Invalid Image for all unknown pixel > formats? Looking at the code, I don't think it truly ran out of handles. I believe you right. Noticed (FYI) that we load the image correctly on WinXP. Strange. It's as if Windows 7 broke their native image loading code... I'll look at this more closely. Huh - bizarre. WinXP is changing the pixel format of the image to be PixelFormat24bppRGB.
Felipe, can you try your snippet again, except change the code in Image.initNative(String) so that the switch(pixelFormat) handles PixelFormat32bppCMYK, i.e.
case Gdip.PixelFormat24bppRGB:
case 8207: //Gdip.PixelFormat32bppCMYK: <<< add this line
this.handle = createDIB(width, height, 24);
break;
and see what happens? <g>
It looks like we are not the only ones to trip over this problem: http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/c626a478-e5ef-4a5e-9a73-599b3b7a6ecc That fixed it. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=07bbcf11868d01025ec708e21da08af7b897caa1 So you can load a CMYK jpeg swt Image natively on Windows 7 now (i.e. using Image constructor). You can't load using ImageData, but that is captured in bug 290164 - [Image Loading] ImageLoader cannot load JPEG files with CYMK color model |