GNOME Bugzilla – Bug 50867
critical warnings from plug-in previews for small images
Last modified: 2009-08-15 18:40:50 UTC
I'm not sure exactly what caused this, but the symptom is that in gimp_viewable_get_preview() an assertion on width>0 fails, resulting in a segmentation fault. To reproduce: 1) Open a new image of size 1x63 2) Scale it to 10x630 3) open a new image of size 256x256 4) Filters->Render->Natural->Flame on the 256x256 image Dave Neary.
I just tried it with Gimp 1.2.1 (under Solaris and Linux). I do not get a crash, but running the Flame plug-in produces 24 times the same error message: Gtk-CRITICAL **: file gtkpreview.c: line 304 (gtk_preview_draw_row): assertion `data != NULL' failed. Note that the 2nd step described above (resize) is not necessary, and even the 3rd step (new image) is optional. The simple fact of creating a new image of size 1x63 will trigger the bug as soon as you run the Flame plug-in on any image. As soon as the bug is found, you have to exit and re-start the Gimp in order to get rid of it. Note that the Flame plug-in appears to work correctly, at least for me with 1.2.1 (but Dave gets a segfault with 1.3.0). Further experiments reveal that the following conditions do _not_ trigger the bug: - Start with a 256x256 image and run Flame on it. No problem. - Create a 256x256 image, then a second one and use Flame. OK. - Create a 1x1 image, then 256x256 and use Flame. OK. - Create a 63x1 image, then 256x256 and use Flame. OK. - Create a 63x63 image, then 256x256 and use Flame. OK. - Create a 3x63 image, then 256x256 and use Flame. OK. But: - Create a 1x63 image and use Flame on it. Bug! - Create a 1x63 image, then 256x256 and use Flame. Bug! - Create a 2x63 image and use Flame on it. Bug! - Create a 2x63 image, then 256x256 and use Flame. Bug! I could only reproduce this with a size of 1x63 or 2x63. I could not find the bug with other image sizes, including 3x63, 63x63, 63x1 and other random values that I tried. I got the exact same 24 error messages with other plug-ins too. Here are some of the plug-ins that are affected: Filters -> Render -> Nature -> Flame... Filters -> Map -> Bump Map... Filters -> Map -> Displace... Filters -> Colors -> Map -> Sample Colorize... Filters -> Artistic -> GIMPressionist... But many other plug-ins with previews seem to be immune (IWarp, Map Object, GFlare, Fractal Explorer, ...). I still have no idea of what is happening, but hopefully this amount of data will help to track down this bug. If this really crashes Gimp 1.3.0 (I don't have it here for the moment, I would have to go home to try the CVS version), then the priority of this bug should be moved to "high". Can anyone confirm?
Just to make it clear again that it is probably not a resize problem (like bug #13296 and bug #22567), the following steps are sufficient to trigger the bug: - Create a new image, size 2x63 - Call Filter -> Map -> Bump Map... With Gimp 1.2.1, I get the 24 warning messages described above, as soon as the plug-in window is displayed. Can anyone confirm what happens with the current CVS version?
Re-assigning all Gimp bugs to default component owner (Gimp bugs list)
The original bug-report was gimp-1.3 only. There is no function called gimp_viewable_get_preview() in the 1.2 code base. However it turns out that there are some plug-ins in 1.2.2 doing the wrong thing with a GtkPreview if the image is small. I have changed the bug summary accordingly. We can safely ignore the 1.3 problem for now (and I think it has already been fixed anyway).
The bug was that gimp_drawable_get_thumbnail_data() and gimp_image_get_thumbnail_data() returned NULL and set width or height to zero for certain combinations of the requested width and height. This code was called from gimp_drawable_menu and gimp_image_menu to draw the previews in the menus. I have changed these routines so the returned thumbnail is always at least 1 pixel wide and tall. 2001-10-03 Sven Neumann <sven@gimp.org> * app/drawable_cmds.c * app/image_cmds.c * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/image.pdb: always return a thumbnail of at least 1 pixel width and height so plug-ins don't have to check the return value. Seems to fix bug #50867, please test!
Fix is part of gimp-1.2.3, which has just been released. Bug is now CLOSED.