After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 469831 - crash in display downscaling code
crash in display downscaling code
Status: RESOLVED DUPLICATE of bug 469567
Product: GIMP
Classification: Other
Component: User Interface
2.4.x
Other Windows
: Normal critical
: 2.4
Assigned To: GIMP Bugs
GIMP Bugs
: 474978 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-08-24 08:20 UTC by Alexander Rabtchevich
Modified: 2008-10-30 19:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
small file (676.60 KB, image/jpeg)
2007-08-24 12:58 UTC, Alexander Rabtchevich
  Details
debug sanity spew (9.80 KB, patch)
2007-09-05 15:23 UTC, Øyvind Kolås (pippin)
none Details | Review

Description Alexander Rabtchevich 2007-08-24 08:20:29 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.
Comment 1 Alexander Rabtchevich 2007-08-24 08:22:50 UTC
Just to say 2.3.19 or 2.3.18 worked OK with it.
Comment 2 Alexander Rabtchevich 2007-08-24 08:42:02 UTC
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. 
Comment 3 Øyvind Kolås (pippin) 2007-08-24 10:28:16 UTC
I suspect this display issue is currently fixed in the most recent SVN.
Comment 4 Alexander Rabtchevich 2007-08-24 10:49:38 UTC
 Øyvind, I can send you jpg to test - I cannot do it myself.
Comment 5 Raphaël Quinet 2007-08-24 12:30:14 UTC
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).
Comment 6 Alexander Rabtchevich 2007-08-24 12:52:01 UTC
Raphael, I've sent a jpg to your address.
Comment 7 Alexander Rabtchevich 2007-08-24 12:58:06 UTC
Created attachment 94253 [details]
small file

Load the file, rotate it via menu and zoom in - out.
Comment 8 Raphaël Quinet 2007-08-24 13:47:18 UTC
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.
Comment 9 Alexander Rabtchevich 2007-08-27 09:42:36 UTC
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.  
Comment 10 Raphaël Quinet 2007-08-27 15:58:13 UTC
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 ***
Comment 11 Alexander Rabtchevich 2007-09-05 13:29:17 UTC
RC2 still crashes often at preview and scaling. Hard to reproduce because it happens after editing some images.
Comment 12 Alexander Rabtchevich 2007-09-05 13:40:55 UTC
It always happens at downscaling.
Comment 13 Alexander Rabtchevich 2007-09-05 14:39:36 UTC
I've got a crash at upscaling from scale less than 25%.
Comment 14 Øyvind Kolås (pippin) 2007-09-05 15:22:06 UTC
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.
Comment 15 Øyvind Kolås (pippin) 2007-09-05 15:23:07 UTC
Created attachment 94999 [details] [review]
debug sanity spew
Comment 16 Alexander Rabtchevich 2007-09-05 16:02:58 UTC
So,  Øyvind, it's the same story with RC2 than with RC1? ;)
Comment 17 Øyvind Kolås (pippin) 2007-09-05 16:25:20 UTC
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.
Comment 18 Michael Schumacher 2007-09-05 16:28:51 UTC
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.
Comment 19 Martin Nordholts 2007-09-05 19:28:28 UTC
Reopening and putting on the 2.4 milestone since we need to fix this before 2.4.
Comment 20 Michael Natterer 2007-09-07 08:47:43 UTC
Pippin, the finding of Jörg in bug #472770 (comment 21) sounds interesting.
It appears to be crashing on the bottom-right tile only.
Comment 21 Martin Nordholts 2007-09-09 07:06:37 UTC
*** Bug 474978 has been marked as a duplicate of this bug. ***
Comment 22 Jörg Gittinger 2007-09-12 10:04:44 UTC
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. 
Comment 23 Øyvind Kolås (pippin) 2007-09-12 11:20:00 UTC
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.
Comment 24 Øyvind Kolås (pippin) 2007-09-12 20:26:14 UTC

*** This bug has been marked as a duplicate of 469567 ***