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 101340 - Saving .xcf on full filesystem hangs GIMP
Saving .xcf on full filesystem hangs GIMP
Status: VERIFIED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: High major
: 2.0
Assigned To: GIMP Bugs
Daniel Egger
Depends on:
Blocks:
 
 
Reported: 2002-12-16 11:49 UTC by Ulrich.Windl
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ulrich.Windl 2002-12-16 11:49:18 UTC
I was trying to save a small image with two layers as XCF on a floppy. As
it turned out, the floppy had not enough capacity. However GIMP did not
present an error message, nor did it finish the save dialog. Even when
deleting a file from the floppy using another command window, GIMP remained
unresponsive. I had to terminate the application. (This was with Windows/XP
SP1)
Comment 1 Sven Neumann 2002-12-16 12:24:36 UTC
Looked at the code and found that it doesn't check the return value of
the call to fwrite() and thus gets stuck in an endless loop in case of
an error. That's pretty bad and needs to be fixed in the stable tree
as well. Not trivial since the error needs to be propagated up thru
all the xcf functions.
Comment 2 Nathan Summers 2002-12-19 07:35:13 UTC
2003-12-19  Nathan Summers  <rock@gimp.org>

	* app/xcf.c: actually check to make sure writes are successful,
	instead of unconditionally assuming that they are.  Fixes bug
	#101340.

Tested with a loopback device on an absurdly small file.  It works. 
The write complained and exited instead of hanging. It did leave a
tile reference count of 1, however.
Comment 3 Sven Neumann 2002-12-19 10:52:13 UTC
Reopening this report since the bug is still present in GIMP-1.3.
Comment 4 Sven Neumann 2002-12-19 11:27:07 UTC
Quick note to whoever wants to try a fix in HEAD:

Let's handle the error reporting in HEAD using GError so that we can
pass the error message all the way up instead of using g_message() all
over the code. So instead of introducing a gboolean parameter, please
use GError.
Comment 5 Nathan Summers 2002-12-20 06:20:13 UTC
Fixed in HEAD as well.

2002-12-20  Nathan Summers  <rock@gimp.org>

	* app/xcf/xcf-write.[ch]
	* app/xcf/xcf-save.c
	* app/xcf/xcf.c: ported the fix for bug #101340 over from the stable 
	branch.  Uses GError to report errors, unlike the stable version, which
	uses a pointer to gboolean.
	
	* app/xcf/xcf-seek.[ch]: check the return value of fseek and ftell for
	errors.  Return FALSE and set GError if an error is detected.

	* app/xcf/xcf-load.c: since the xcf-seek functions use GError now,
	added a NULL for the error parameter.  Added basic error checking
	on the return value of the xcf-seek functions.  In the future,
	changing xcf-load.c to use GError more completely should be
	considered.
	
	* po/POTFILES.in: mark the error messages added for translation

Comment 6 Raphaël Quinet 2003-06-20 20:19:43 UTC
The fix is part of the stable release 1.2.4.  Closing this bug.