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 21028 - should warn user about enormous memory consumption
should warn user about enormous memory consumption
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
1.x
Other All
: Normal trivial
: 2.0
Assigned To: GIMP Bugs
Daniel Egger
Depends on:
Blocks: 78064
 
 
Reported: 2000-08-15 20:00 UTC by dannyt
Modified: 2003-12-08 21:53 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
a first attempt to address the problem (7.20 KB, patch)
2002-04-12 19:40 UTC, Sven Neumann
none Details | Review
Patch against CVS (4.28 KB, patch)
2003-12-07 21:26 UTC, Dave Neary
none Details | Review

Description dannyt 2001-01-28 15:57:13 UTC
Package: gimp
Version: 1.1.24

Name........: Danny Tholen
Email.......: dannyt@sci.kun.nl
Platform....: AMD k6-2 350MHz, 128MB, Maxtor 7.5 GB 7200rpm, Mandrake 7.0 (kernel 2.2.16)
GIMP Version: 1.1.24
GTK Version.: 1.2.8
WM/Version..: kde 1.1.2


-- Other system notes:

--

-- Problem description:
When trying to resize an image I changed in the 'scale image' 
menu the ratio X and ratio Y to 25.0000. Actually I meant 0.25
but well, sometimes you don't pay attention:) The image was
already big (1468*3000 pixels) and this ofcourse would take some
calculations. But that it just kept swallowing more CPU time while
the harddisk was making an amazing amount of noise ;)
didn't sound very good to me. After a time even the mouse stopped
working, and I couldn't do a normal reboot. So I decided to hit
the reset button after 45 min or so. I found that a 
-rw-------   1 danny    danny    190644224 Aug 15 21:24 gimpswap.8967h
was created which was 20k short of my entire free space
on that partition.

I think might be good to check whether a users command is
not taking the system down. It shouldn't be able to slow
down the machine that much.

--


-- How to repeat:
just scale a picture to insane amounts i guess.

--


-- Other comments:
wonder if i can use this as a sort of DoS attack *grin*
--




------- Bug moved to this database by debbugs-export@bugzilla.gnome.org 2001-01-28 10:57 -------
This bug was previously known as bug 21028 at http://bugs.gnome.org/
http://bugs.gnome.org/show_bug.cgi?id=21028
Originally filed under the gimp product and general component.

The original reporter (dannyt@sci.kun.nl) of this bug does not have an account here.
Reassigning to the exporter, debbugs-export@bugzilla.gnome.org.
Reassigning to the default owner of the component, egger@suse.de.

Comment 1 Raphaël Quinet 2001-02-09 15:07:55 UTC
The preferences dialog already contains a "Maximum Image Size"
option that triggers a warning if the user tries to create a new
image that is too large.  The same value could be also tested when
the user wants to scale or resize the image.

In some cases, the current image will already be larger than the
threshold that generates a warning, and the user will probably not
want to see a warning dialog popping up after every resize.  So a
better solution would be something like this:
  ...
  if ((new_image_size > 2 * current_image_size)
       && (new_image_size > max_new_image_size))
  {
     resize_confirm_dialog (...);
  }
  ...
Comment 2 Raphaël Quinet 2001-04-26 18:13:40 UTC
Re-assigning all Gimp bugs to default component owner (Gimp bugs list)
Comment 3 Daniel Egger 2001-10-03 17:18:37 UTC
Can we fix this for 1.2.3?
Comment 4 Sven Neumann 2001-10-03 18:23:32 UTC
Well yes, of course we can fix this for 1.2.3 if someone comes up
with a small and clean patch. This will probably add a few new strings
that need to be translated, so it shouldn't happen too close to a
release.
Comment 5 Sven Neumann 2002-04-12 16:03:31 UTC
Setting target milestone to 1.2.4. Perhaps someone wants to come up
with a patch...
Comment 6 Sven Neumann 2002-04-12 19:36:25 UTC
Here's a patch to get us started with. I wouldn't call this a clean
patch but it is implemented along the uglyness of the current code...
This patch does not address the problem of the user trying to scale
layers to insane sizes.
Comment 7 Sven Neumann 2002-04-12 19:40:07 UTC
Created attachment 7682 [details] [review]
a first attempt to address the problem
Comment 8 Dave Neary 2003-05-10 18:15:58 UTC
It's been over a year since the patch was attached, with no
follow-ups. Can it be applied as-is? If not, I suggest bumping to
1.2.5, or declaring WONTFIX.

Dave.
Comment 9 Sven Neumann 2003-05-11 00:09:26 UTC
I don't like the patch although I wrote it. Postponing to 1.2.5.
Comment 10 Dave Neary 2003-05-21 16:26:21 UTC
Moving to 1.2.6 milestone, since it is looking like there will be a pretty quick
1.2.( release.
Comment 11 Dave Neary 2003-11-18 09:14:52 UTC
Setting milestone to 1.3.x, as per comments added to bug #78064.

Dave.
Comment 12 Dave Neary 2003-12-07 21:26:12 UTC
Created attachment 22196 [details] [review]
Patch against CVS
Comment 13 Dave Neary 2003-12-07 21:29:21 UTC
Like Sven, I'm not too happy with this patch - there's lots of
repeated code that could be shared. A little bit of cleaning up should
make it sufficient, though. I would suggest modifying
gimp_image_check_scaling so that it's a boolean rather than an action
verb (something like gimp_image_is_bad_scaling, except better).

Dave.
Comment 14 Dave Neary 2003-12-08 12:13:52 UTC
After talking to mitch, here's the plan...

gimp_image_scale_check () should return an enum which has the possible
values GIMP_IMAGE_SCALE_OK, GIMP_IMAGE_SCALE_TOO_SMALL and
GIMP_IMAGE_SCALE_TOO_BIG. The result would then be used in a switch.
Ideally, TOO_SMALL and TOO_BIG would share the same GUI code, and just
change the message used.

Cheers,
Dave.
Comment 15 Dave Neary 2003-12-08 21:53:11 UTC
Fixed in CVS. Not going to be fixed in 1.2.

2003-12-08  Dave Neary  <bolsh@gimp.org>
                                                                     
          
        * app/core/core-enums.h:
        * app/core/gimpimage-scale.[ch]: Added the
GimpImageScaleCheckType enum and used it in gimp_image_scale_check()
which used to be gimp_image_check_scaling().
                                                                     
          
        * app/gui/image_commands.c: Used the above when checking
scaling parameters to display a message if the image is too big or too
small after scaling. Closes bug #21028.