GNOME Bugzilla – Bug 469831
crash in display downscaling code
Last modified: 2008-10-30 19:57:39 UTC
Steps to reproduce: 1. Load particular Minolta G500 RAW file via UFRaw 0.12.1. 2. Rotate the file to portrait within UFRaw. 3. Process file to import into GIMP. 4. Gimp crashes immediately after trying to switch to ready image window. If the file is imported in landscape orientation it imports well, but GIMP crashes when the image is rotated within GIMP. Stack trace: Other information: I can send MRW file or upload it to some free server.
Just to say 2.3.19 or 2.3.18 worked OK with it.
It seems the problem is with image size. GIMP handles 2607x1956 well, but it crashes with 1956x2607. If any image is loaded as 1956x2607 from disk (as jpg), GIMP handles it well. But if an 2607x1956 image is loaded from disk (as jpg too) and then rotated in GIMP, GIMP crashes. It happens not immediately, but in a few seconds.
I suspect this display issue is currently fixed in the most recent SVN.
Øyvind, I can send you jpg to test - I cannot do it myself.
Alexander, if the file is too big to attach it to this bug report, you can also try sending it to me at: raphael(dot)quinet(at)gmail(dot)com. (please don't send large files to my gimp.org address).
Raphael, I've sent a jpg to your address.
Created attachment 94253 [details] small file Load the file, rotate it via menu and zoom in - out.
I cannot reproduce that problem. I tried both with the low-quality image attached here and with the other one sent by mail (which had been marked as spam, so it took me a while to find it). I can open them in GIMP and rotate them by 90 degrees clockwise or counter-clockwise without any problems. It is likely that the problem has already been solved by the changes made by pippin a few days after the RC1 release. But maybe the bug is specific to Windows and maybe it is still present. I do not use Windows, so it would be very nice if you or some other Windows user could try the test image attached here and see if it causes a crash with the current GIMP from SVN.
I have one image which crashes 2.4 RC1 after cropping. It happens every time. I guess it's the same bug. Are there plans to release RC2 or repack current SVN as RC1? RC1 is unusable so it's hard to test it.
RC2 should be released later this week. This bug is probably a duplicate of bug #469785 or bug #470302, fixed by pippin last week. I am now marking it as such, but feel free to re-open this bug report if the problem persists in RC2. *** This bug has been marked as a duplicate of 469785 ***
RC2 still crashes often at preview and scaling. Hard to reproduce because it happens after editing some images.
It always happens at downscaling.
I've got a crash at upscaling from scale less than 25%.
The problem is not related to a specific image size but to the size of the edge tiles. GIMP uses an optimization to gain a few bytes of memory with the cost of additional logic (tiles are not always 64x64). I haven't had time to dig into fixing this issue but I've created a patch against gimpdisplayshell-render that performs continuous sanity checking of the pointers used, I'd expect one of these sanity print outs to occur just before the crash. It seems win32 is more sensitive than linux for these "slight" overshooting memory accesses.
Created attachment 94999 [details] [review] debug sanity spew
So, Øyvind, it's the same story with RC2 than with RC1? ;)
Almost, but not quite, the issue that mainly was crashing GIMP in RC1, at least on Linux was a division by zero. The story is a bit different with RC2 since it doesn't crash on Linux. Apparently win32 is a bit more picky than Linux about reads occurring just after allocated memory. I'm quite condifent that this is the problem we see here (as well as the main issue the code debugging code I attached to this discussion is reporting on.
Problems exactly like this one have been located because of the different behaviour of the Windows platforms in the past, so I am pretty sure that we've got another one now.
Reopening and putting on the 2.4 milestone since we need to fix this before 2.4.
Pippin, the finding of Jörg in bug #472770 (comment 21) sounds interesting. It appears to be crashing on the bottom-right tile only.
*** Bug 474978 has been marked as a duplicate of this bug. ***
Regarding comment #20: I now have crashes not only in the bottom-right corner on my XP installation. Possibly it happens while displaying any right tile - but I cannot say for sure. When letting gdb watch gimp-2.4.exe (RC2) it crashes in render_image_tile_fault_one_row + 1428.
As seen when running the debug sanity patch in comment #15, this crash is most likely due to out of bounds access of memory. The issue is that GIMP tries to save a couple of bytes of memory by not having a uniform tile size. The correct way to fix this issue is to add checks that the functions used for the resampling make sure they do not go beyond the ewidth/eheight of tiles of the right side/bottom side of the buffer. (Or perhaps to make sure the projection uses only full sized 64x64 tiles if this is possible elsewhere to reduce the performance impact of more complicated logic.) The problem should be possible to provoke with any image size that is not a multiple of 64, both vertically and horizontally.
*** This bug has been marked as a duplicate of 469567 ***