GNOME Bugzilla – Bug 309170
gimp crash when opening or creating certain size images
Last modified: 2008-01-15 12:57:29 UTC
Steps to reproduce: 1. open a 1024x768 image (for example background-1024x768.png from an fbsplash theme 2. or create a new image and use the 1024x768 template 3. Stack trace: Starting program: /usr/bin/gimp (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) ---Type <return> to continue, or q <return> to quit--- (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) (no debugging symbols found) [Thread debugging using libthread_db enabled] [New Thread -1213674848 (LWP 24212)] [New Thread -1217758288 (LWP 24389)] art_render_invoke: no image source given [New Thread -1226196048 (LWP 24390)] [New Thread -1226466384 (LWP 24391)] [New Thread -1226732624 (LWP 24392)] art_render_invoke: no image source given Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1213674848 (LWP 24212)] 0x080a288a in ?? () (gdb) q The program is running. Exit anyway? (y or n) y gimp --verbose /etc/splash/livecd-2005.0/images/background-1024x768.png INIT: gimp_load_config Parsing '/etc/gimp/2.0/gimprc' Parsing '/home/mark/.gimp-2.2/gimprc' gimp_composite: use=yes, verbose=no Processor instruction sets: -mmx -sse -sse2 -3dnow -altivec -vis Adding theme 'Small' (/usr/share/gimp/2.0/themes/Small) Adding theme 'Default' (/usr/share/gimp/2.0/themes/Default) Writing '/home/mark/.gimp-2.2/themerc' INIT: gimp_initialize INIT: gimp_real_initialize INIT: gui_initialize_after_callback INIT: gimp_restore INIT: gui_restore_callback GimpClipboard: writable pixbuf format: image/png GimpClipboard: writable pixbuf format: image/x-icon GimpClipboard: writable pixbuf format: image/bmp GimpClipboard: writable pixbuf format: image/x-bmp GimpClipboard: writable pixbuf format: image/x-MS-bmp GimpClipboard: writable pixbuf format: image/jpeg INIT: gimp_real_restore Starting extension: 'extension_script_fu' INIT: gui_restore_after_callback loading menu '/usr/share/gimp/2.0/menus/toolbox-menu.xml' for /toolbox-menubar loading menu '/usr/share/gimp/2.0/menus/image-menu.xml' for /dummy-menubar loading menu '/usr/share/gimp/2.0/menus/image-menu.xml' for /image-menubar Segmentation fault (script-fu:24399): LibGimpBase-WARNING **: script-fu: wire_read(): error Other information: seems to happen for 800x600 and 1024x768, but 640x480, 800x600, 1280x1024 and 1600x1200 seem to work fine.
I can't reproduce this. What OS?
sorry. i'm running gentoo linux. [ebuild R ] dev-libs/glib-2.6.5 -doc -hardened -static 0 kB [ebuild R ] x11-libs/gtk+-2.6.8 -doc +jpeg -static +tiff 0 kB [ebuild R ] media-gfx/gimp-2.2.7-r1 -aalib (-altivec) -debug +doc +gimpprint +gtkhtml -hardened +jpeg +lcms -mmx +mng +png +python -scanner -smp -sse +svg +tiff +wmf 0 kB linux kernel 2.6.12 emerge --info Portage 2.0.51.19 (default-linux/x86, gcc-3.4.4, glibc-2.3.5-r0, 2.6.12-love1 i686) ================================================================= System uname: 2.6.12-love1 i686 Intel(R) Pentium(R) M processor 1500MHz Gentoo Base System version 1.6.12 Python: dev-lang/python-2.3.5,dev-lang/python-2.4.1-r1 [2.4.1 (#1, Jun 20 2005, 17:52:12)] dev-lang/python: 2.3.5, 2.4.1-r1 sys-apps/sandbox: [Not Present] sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.5, 1.8.5-r3, 1.6.3, 1.9.5, 1.7.9-r1, 1.4_p6 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.16 virtual/os-headers: 2.6.8.1-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-Os -march=pentium-m -mmmx -msse -msse2 -fforce-addr -ftracer -mfpmath=sse -pipe" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" CXXFLAGS="-Os -march=pentium-m -mmmx -msse -msse2 -fforce-addr -ftracer -mfpmath=sse -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="ftp://mirror.pacific.net.au/linux/Gentoo http://mirror.isp.net.au/pub/gentoo/ ftp://mirror.isp.net.au/pub/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.gentoo.org/gentoo-portage" USE="x86 X a52 aac acpi alsa avi bash-completion berkdb bitmap-fonts bonobo bzip2 cairo cdr crypt cups curl dbus divx4linux dvd eds emboss encode esd exif fam fbcon foomaticdb gd gdbm gif gnome gpm gstreamer gtk gtk2 guile hal howl imagemagick imlib java jpeg ldap libg++ libwww mad mikmod mmx mono motif mozilla mp3 mpeg mysql ncurses nptl offensive ogg oggvorbis opengl oss pam pcmcia pda pdflib perl pic png python qt quicktime readline samba sdl spell sqlite sse sse2 ssl svg tcpd tetex theora tiff truetype truetype-fonts type1-fonts usb v4l vorbis xinerama xml2 xv xvid zlib video_cards_radeon userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
That looks like a problem caused by overoptimization. There might very well be a bug somewhere in GIMP or in one of the other libraries involved. But since the problem isn't reproducable on any other system but yours, you will have to try to come up with a useful stack trace yourself.
one interesting thing i noticed was that it seems tied to my resolution. i'm running on a laptop in 1024x768 mode. if i run at 800x600 or 640x480 then i can open the 1024x768 image, but not an image in the same resoultion as the screen. but i will rebuild with debug enabled and try and get a better stack trace. i'll also try some different resolution combinations.
You might be hitting a bug in the downscaling routines then. GIMP will use a zoom ratio of < 1.0 if your image is larger than the screen.
i think you have something there. here's the new stack trace with debug symbols, and you'll see the first hit is at "gimp_display_shell_scale_get_fraction". one additional interesting item. the bug happens when i use the File | Open menu. but if i use File | Open Recent | <select file>, the bug doesn't get hit. the file opens, and the zoom has been set to 67%. even odder, however, is that if instead of selecting the file in the Open Recent menu using the mouse, i try using the keyboard accelerator (in this cast Ctrl+1), then i do get the usual crash! stack trace follows: Starting program: /usr/bin/gimp [Thread debugging using libthread_db enabled] [New Thread -1214047584 (LWP 13039)] [New Thread -1218417744 (LWP 13044)] art_render_invoke: no image source given [New Thread -1226962000 (LWP 13045)] [New Thread -1227228240 (LWP 13046)] art_render_invoke: no image source given Program received signal SIGSEGV, Segmentation fault.
+ Trace 61571
Thread NaN (LWP 13039)
If that line number is correct, the crash is in this line: next_cf = floor (remainder); ... which only involves 2 automatic variables, and a standard C math function. This points to your compiler. I'd suggest removing questionable CFLAGS, starting with -mfpmath=sse.
i removed -mfpmath=see from my CFLAGS and that seems to have solved the problem. thanks heaps.
You should probably file a bug report with the gcc folks.
for completeness, here's the link to the bug entered for gcc: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22289
the gcc folks have responded to the bug with the following: ------- Additional Comments From giovannibajo at libero dot it 2005-07-04 15:34 ------- To produce a testcase, you could try extracting the routine that is miscompiled and attach it to this bug (in a compilable form, so preprocessed with all needed headers). I believe the GIMP folk can help you with this. It might be that the bug is visible by just looking at the assembly code generated by the compiler (-S). any easy instructions i could follow to give the gcc folks what they need?