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 681845 - Cancel image export crashes or freezes gimp
Cancel image export crashes or freezes gimp
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.24.x
Other All
: High critical
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
: 665686 667012 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-08-14 14:23 UTC by danjjl
Modified: 2013-05-30 00:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Error messages following crash (14.34 KB, text/plain)
2012-08-14 14:23 UTC, danjjl
  Details
stack trace (16.09 KB, text/plain)
2012-08-15 10:46 UTC, danjjl
  Details
stack trace with debugging symbols (28.22 KB, text/plain)
2012-08-16 20:54 UTC, danjjl
  Details
stack trace 2.8.2 (27.12 KB, text/plain)
2012-08-29 08:21 UTC, danjjl
  Details
Patch that might fix the problem (676 bytes, patch)
2012-11-05 02:43 UTC, Michael Natterer
none Details | Review

Description danjjl 2012-08-14 14:23:43 UTC
Created attachment 221142 [details]
Error messages following crash

Steps to reproduce :
- Open a picture
- File -> Export
- rename the file (eg from tree.jpg -> tree2.jpg)
- click export
- click cancel
- click cancel

Gimp crashes or freezes
Bug occurs if export is from jpg -> jpg and jpg -> png (I did not try other file formats)

The new filename will be first in recently opened list.
Comment 1 André Klapper 2012-08-15 08:37:39 UTC
Thanks for taking the time to report this bug.
Without a stack trace from the crash it's very hard to determine what caused it.
Can you get us a stack trace by starting GIMP under "gdb"? Please see http://live.gnome.org/GettingTraces (and the Details subpage) for more information on how to do so. Thanks in advance!
Comment 2 danjjl 2012-08-15 10:46:04 UTC
Created attachment 221246 [details]
stack trace
Comment 3 danjjl 2012-08-15 11:05:54 UTC
I don't know if it is important to mention,  my gimp 2.8 is installed from this ppa : http://ppa.launchpad.net/otto-kesselgulasch/gimp/ubuntu/ precise/main
Comment 4 André Klapper 2012-08-16 17:24:59 UTC
The stacktrace misses any debugging symbols...
Comment 5 danjjl 2012-08-16 20:54:14 UTC
Created attachment 221472 [details]
stack trace with debugging symbols
Comment 6 danjjl 2012-08-29 08:21:05 UTC
Created attachment 222721 [details]
stack trace 2.8.2
Comment 7 Michael Natterer 2012-09-07 08:38:55 UTC
I have seen this crash before, and it happend in GTK+. Does anyone
remember the old bug?
Comment 8 Michael Natterer 2012-10-09 22:05:47 UTC
Please paste the output of "gimp --version --verbose"
Comment 9 danjjl 2012-10-10 09:00:08 UTC
jonathan@Bill:~$ gimp --version --verbose
GNU Image Manipulation Program version 2.8.2
git-describe: GIMP_2_8_0-194-ga42a02e

using GEGL version 0.2.0 (compiled against version 0.2.0)
using GLib version 2.32.3 (compiled against version 2.32.3)
using GdkPixbuf version 2.26.1 (compiled against version 2.26.1)
using GTK+ version 2.24.10 (compiled against version 2.24.10)
using Pango version 1.30.0 (compiled against version 1.30.0)
using Fontconfig version 2.8.0 (compiled against version 2.8.0)
using Cairo version 1.10.2 (compiled against version 1.10.2)
Comment 10 Chris 2012-10-14 01:39:08 UTC
I have the same version from the same source with the same version info and am unable to reproduce the bug. I am using a 64 bit system. I tested with a JPG that I opened and with a PDF from which I imported page 1. Attempted to reproduce by exporting each as both JPG and as PNG; canceled twice per instructions without incident, but do not understand the statement "The new filename will be first in recently opened list." My "Recently Used" pseudo-folder contains only other folders.
Comment 11 danjjl 2012-10-14 10:29:28 UTC
I don't know why you can not reproduce the bug. I am also running a 64 bit system.

After Gimp crashes. When I reopen Gimp the first file under 'File -> Open Recent' is an inexistant file with the name of the file of which I cancelled the export.
Comment 12 Chris 2012-10-14 16:26:16 UTC
Okay - I agree that 'File -> Open Recent' doesn't make sense. If the export doesn't complete the exported file name shouldn't appear in that list. I'm not sure that an Exported file name should _ever_ appear in that list, but that's not my call.

Curiously, the filename doesn't appear in 'File -> Open Recent' unless you restart the GIMP. After hitting 'Cancel' twice I see only the file I opened; after restarting the app I see both.

However, I still don't get a hang or a crash. If you rename your ~/.gimp-2.8 out of the way and restart GIMP does it still happen?
Comment 13 danjjl 2012-10-14 16:42:11 UTC
I just tried after renaming ~/.gimp-2.8, the crash still occurs

(Is the instruction "rename the file (eg from tree.jpg -> tree2.jpg)" clear enough?
It means give a new name to the file you want to export (in the Gimp Export image dialogue))
Comment 14 Chris 2012-10-14 17:30:30 UTC
Here's what I'm doing, exactly:

$ gdb gimp
(gdb) run
[...]
File -> Open
[Recently Used] -> "GRAB.jpg" (double-click)
File -> Export
Right Arrow, "999", <Enter>
Cancel (Export Image as JPEG Dialog button)
Cancel (Export Image Dialog button)
(Move cursor to see coordinates change; click, drag-circle to paint with airbrush)
File -> Export
<End>, <Backspace>(x3), "png", <Enter>
Cancel (Export Image as PNG Dialog button)
Cancel (Export Image Dialog button)
(Move cursor; paint)
File -> Export
<Home>, "zz"
Click "Export" button, twice (once to clear name completion popup; once to click button)
"Show Preview" checkbox clicked.
"Advanced Options"
Set Quality to 73.
Cancel (Export Image as JPEG Dialog button)
Cancel (Export Image Dialog button)
Colors -> Invert.

No problems here with this flow.

The "File -> Open Recent" menu contains only the file I opened (GRAB.jpg).

I did get a debug message from GIMP:

(gimp:20806): Gimp-Display-CRITICAL **: gimp_display_shell_set_layer_style: assertion `GIMP_IS_LAYER (layer)' failed

... That came just at the end of the flow but I couldn't get it to happen again, so I restarted GIMP. File -> Open Recent now contains the aborted exports along with their 'broken' icons (if GIMP already knows the file can't be read, why bother displaying it?).

I can reproduce the 'CRITICAL' warning by opening the file, going to "File -> Export", exporting as JPEG, turning on the preview and adjusting the Quality setting.

In this case I get the warning twice. If I hit "Cancel" I get it a 3rd time but I can hit "Cancel" again and go back to the image and paint on it successfully.

If I switch to Single-Window mode and repeat the Export procedure, things still appear to work fine.
Comment 15 danjjl 2012-10-14 17:48:26 UTC
Reproducing the same steps(in Single-Window mode) I get it crashing after this instruction Cancel "(Export Image Dialog button)"
Comment 16 Chris 2012-10-15 18:07:56 UTC
If you don't mind digging deeper, I have two other suggestions. The first is to create a new user and see if the problem persists there. The second is to install the same OS and version of GIMP into a VirtualBox session and see if the problem exists there.

Assuming that one of these two things works, it's then a matter of trying to figure out how the systems are different ... :-/
Comment 17 danjjl 2012-10-16 08:42:23 UTC
Wow! A new user works fine! I suppose I just need to migrate to a new user.
Thank you
Comment 18 Michael Schumacher 2012-10-16 12:25:06 UTC
You should make a copy of your current GIMP user profile directory and keep it around for research. Then you can delete the original and have GIMP create a new one (but make sure that you got a copy, otherwise all user support staff on this planet will collectively hate you :)

If this fixes the problem, then you can start to compare the two directories - i.e. the configuration files, the other contents (brushes, scripts, plug-ins, ...) and see if any of them causes the same problem if introduced to the new profile.
Comment 19 Chris 2012-10-16 12:34:29 UTC
It's probably better to figure out where the crash is coming from, rather than just give up and use another account. When I run:

$ strace -s 999 gimp | grep home | grep -v ENOENT | less

... and look at what GIMP is opening, I see:

$HOME/.cache/gegl-0.2/swap
$HOME/.local/share/gegl-0.2
$HOME/.gtkrc-2.0-kde4
$HOME/.kde//share/config/kdeglobals
$HOME/.config/qtcurve/gtk-icons
$HOME/.kde/share/config/gtkrc-2.0
$HOME/.gimp-2.8
$HOME/.local/share//mime/mime.cache
$HOME/.fonts.conf
$HOME/.fonts
$HOME/.fontconfig
$HOME/.local/share/recently-used.xbel
$HOME/.gtk-bookmarks
$HOME/.config/user-dirs.dirs
$HOME/.config/gtk-2.0/gtkfilechooser.ini

I left out access to X11 and PulseAudio files because that's plenty already. Basically, something in your home directory is causing the failure. We've already eliminated .gimp-2.8 when you renamed it; we just need to do the same thing with these other files/directories.

Based on the weirdness in 'File -> Open Recent' I'd suspect it's that 'recently-used.xbel' file. Either rename that out of the way or copy it into the new profile, and then see if that fixes/introduces the problem. Once you've identified the troublesome file, uploading it here will let us troubleshoot further.

I'm clearly using KDE with some KDE/GTK hybrid theme; your strace could differ considerably.
Comment 20 Michael Natterer 2012-11-05 02:43:03 UTC
Created attachment 228067 [details] [review]
Patch that might fix the problem

Can you try the attached patch against gtk-2-24?
Comment 21 Michael Natterer 2012-11-05 19:15:08 UTC
Comment on attachment 228067 [details] [review]
Patch that might fix the problem

This patch was incomplete and not even fixing the bug.
Comment 22 Michael Natterer 2012-11-05 19:19:24 UTC
Fixed in gtk-2-24:

commit 376fc4d712ab16b3770c79b55e00c1b8bc1efcfd
Author: Michael Natterer <mitch@gimp.org>
Date:   Mon Nov 5 20:15:17 2012 +0100

    gtk: clean up properly in GtkFileChooserEntry's dispose() to fix crashes
    
    Don't just unref the completion_store, call discard_completion_store()
    instead which also unsets it as the GtkEntryCompletion's model.  Fixes
    bug 681845 and probably some others, because the situation in this bug
    is completely common.

 gtk/gtkfilechooserentry.c |   28 ++++++++++++----------------
 1 file changed, 12 insertions(+), 16 deletions(-)
Comment 23 danjjl 2012-11-13 12:07:14 UTC
I recently reinstalled my computer and did not think of saving all my home folder. I will not be able to find the faulty configuration file.
Comment 24 Timothy Arceri 2013-05-30 00:53:05 UTC
*** Bug 667012 has been marked as a duplicate of this bug. ***
Comment 25 Timothy Arceri 2013-05-30 00:56:44 UTC
*** Bug 665686 has been marked as a duplicate of this bug. ***