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 774971 - Display errors outputted by GEGL
Display errors outputted by GEGL
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2016-11-23 23:10 UTC by Jehan
Modified: 2017-06-07 14:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Broken GIMP! (138.97 KB, image/png)
2016-11-23 23:10 UTC, Jehan
Details

Description Jehan 2016-11-23 23:10:43 UTC
Created attachment 340656 [details]
Broken GIMP!

So I was testing this weird huge resolution that Ankh proposed: 20321x19451
And it was so big that I swapped, then later ran out of disk space.

The problem is that GIMP didn't output any graphical error. The canvas went simply completely broken giving me no clue that I just ran out of space.

Only the terminal gave me a hint of the problem:

GEGL-/home/jehan/dev/src/gegl/gegl/buffer/gegl-tile-backend-swap.c-Message: unable to write tile data to self: No space left on device (-1/65536 bytes written)

An error should also pop-up on screen.
Comment 1 Jehan 2016-11-23 23:15:35 UTC
Well should it be a GEGL bug first actually? Quickly checkout out the swap tile backend in GEGL, it doesn't look like GEGL actually even return any kind of error, even less an GError or other message to the calling software.
Comment 2 Jehan 2016-11-24 00:16:46 UTC
So results of discussion on IRC is that GEGL won't have any GError propagation. But it should be possible to hook to g_warning outputs to be able to reuse the message in the GUI.

g_log_set_handler() is probably the candidate to operate such log redirection.
Comment 3 Jehan 2016-11-24 01:08:40 UTC
Ok so no GEGL's log domain is simply "GEGL".
Cf. bug 774976.
Comment 4 Jehan 2016-11-24 01:09:32 UTC
Adding 2.10 milestone since I'd like to handle this issue before release. :-)
Comment 5 Jehan 2017-06-07 14:15:52 UTC
Ok. Now GEGL errors would be displayed same as GIMP errors.
I had to strengthen a bit the log handling to make it more robust.

commit 6c2658ea4d37b325e14715acbfd62e466cac94fc
Author: Jehan <jehan@girinstud.io>
Date:   Wed Jun 7 15:09:43 2017 +0200

    app: keep track of all messages displayed by GimpErrorDialog.
    
    This way, you can increment repeated messages even when not the last
    one and you don't overflow the error dialog needelessly when 2 errors
    repeat one after another.

 app/widgets/gimperrordialog.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------
 app/widgets/gimperrordialog.h |   6 ++----
 2 files changed, 58 insertions(+), 49 deletions(-)

commit b7dd2622d1ba206ba086e8cf08f6f1808fe5c32b
Author: Jehan <jehan@girinstud.io>
Date:   Wed Jun 7 15:27:33 2017 +0200

    Bug 774971 - Display errors outputted by GEGL.
    
    Add a log handler so that GIMP can display errors outputted by GEGL.
    Since third party code may run in threads and we have no control on
    these, we have to be sure GTK+ code is run in a thread-safe way, hence
    the usage of gdk_threads_add_idle_full(). This was the case here for
    GEGL, and handling GEGL logs the same way as other GIMP logs would
    result in crashes.

 app/errors.c          | 46 ++++++++++++++++++++++++++++++++++++++--------
 app/gui/gui-message.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 92 insertions(+), 9 deletions(-)