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 320245 - EOG crashes when loading a picture.
EOG crashes when loading a picture.
Status: RESOLVED FIXED
Product: eog
Classification: Core
Component: general
git master
Other Linux
: Normal critical
: ---
Assigned To: EOG Maintainers
EOG Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-30 17:01 UTC by Dennis Cranston
Modified: 2005-11-13 18:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
reproducing the bug only in GTK+ (410 bytes, text/x-csrc)
2005-11-02 23:54 UTC, Claudio Saavedra
  Details
Proposed patch (or workaround?). (3.62 KB, patch)
2005-11-04 11:54 UTC, Claudio Saavedra
none Details | Review
partial patch (4.37 KB, patch)
2005-11-11 00:35 UTC, Claudio Saavedra
none Details | Review
updated patch (3.00 KB, patch)
2005-11-11 18:16 UTC, Claudio Saavedra
none Details | Review

Description Dennis Cranston 2005-10-30 17:01:43 UTC
1. Launch eog
2. Select a picture to view.
3. eog crashes

Output:
$ eog
setting window size: 960/805
setting window size: 960/805
setting window size: 960/805
Instantiate job with id 1.
Starting thread with id 0.
eog-image_load.c
load success: 1
n_images: 1/1
  1 /home/develop/Desktop/IMG_1131.JPG.jpg (2048/1536)
Instantiate job with id 2.
Show exif data
The application 'eog' lost its connection to the display :0.0;
most likely the X server was shut down or you killed/destroyed
the application.
Starting thread with id 1.
Comment 1 Claudio Saavedra 2005-11-02 23:12:09 UTC
I can reproduce the same bug with some images in eog HEAD. For instance, with:

http://www.gnome.org/~csaavedr/images/eog-crasher.jpg

The respective backtrace is:

  • #0 writev
    from /lib/tls/libc.so.6
  • #1 XUnlockDisplay
    from /usr/X11R6/lib/libX11.so.6
  • #2 _X11TransWritev
    from /usr/X11R6/lib/libX11.so.6
  • #3 _XSend
    from /usr/X11R6/lib/libX11.so.6
  • #4 XChangeProperty
    from /usr/X11R6/lib/libX11.so.6
  • #5 IA__gdk_window_set_icon_list
    at gdkwindow-x11.c line 4063
  • #6 gtk_window_realize_icon
    at gtkwindow.c line 2724
  • #7 IA__gtk_window_set_icon
    at gtkwindow.c line 2924
  • #8 display_image_data
    at eog-window.c line 2914
  • #9 IA__g_cclosure_marshal_VOID__VOID
    at gmarshal.c line 77
  • #10 IA__g_closure_invoke
    at gclosure.c line 492
  • #11 signal_emit_unlocked_R
    at gsignal.c line 2485
  • #12 IA__g_signal_emit_valist
  • #13 IA__g_signal_emit
    at gsignal.c line 2288
  • #14 eog_wrap_list_set_model
    at eog-wrap-list.c line 872
  • #15 eog_window_open
    at eog-window.c line 3691
  • #16 job_prepare_model_finished
    at main.c line 203
  • #17 eog_job_call_finished
    at eog-job.c line 440
  • #18 job_finished_cb
    at eog-job-manager.c line 53
  • #19 g_idle_dispatch
    at gmain.c line 3813
  • #20 IA__g_main_context_dispatch
    at gmain.c line 1934
  • #21 g_main_context_iterate
    at gmain.c line 2565
  • #22 IA__g_main_loop_run
    at gmain.c line 2769
  • #23 IA__gtk_main
    at gtkmain.c line 985
  • #24 main
    at main.c line 714

Comment 2 Claudio Saavedra 2005-11-02 23:30:38 UTC
Commenting the calls to gtk_window_set_icon () (eog-window.c: 939, 2914)
evitates eog to crash. I think that the crash must be related to big images
being used as icons in the main window.
Comment 3 Claudio Saavedra 2005-11-02 23:54:22 UTC
Created attachment 54254 [details]
reproducing the bug only in GTK+

I think this is a GTK+ bug. The attached program produces a crash when the
loaded image is too big. The backtrace is the same, so I guess this bug can be
moved to gtk+.
Comment 4 Claudio Saavedra 2005-11-04 11:54:09 UTC
Created attachment 54311 [details] [review]
Proposed patch (or workaround?).

This will prevent EOG to crash. If the image is too big, scale the image to a
safe size and use the new pixbuf for the icon.

Probably it is just a workaround, as I think that GTK+ shouldn't crash if an
image given to gtk_window_set_icon_* is too big, but works.
Comment 5 Claudio Saavedra 2005-11-07 20:50:45 UTC
Commited with little style modifications.

2005-11-07  Claudio Saavedra  <csaavedra@alumnos.utalca.cl>

        * shell/eog-window.c: (job_save_image_finished), (set_window_icon),
        (display_image_data): Resize image before using it as window icon if
        it is too big (Workaround that fixes bug #320245. See related 
        gtk+ bug #320909).
Comment 6 Lucas Rocha 2005-11-09 03:20:41 UTC
Reopening bug because even with the applied patch, gtk_window_set_icon is
generating a warning:

(eog:12702): Gdk-WARNING **: gdk_window_set_icon_list: icons too large

A possible solution would be using image thumbnail as the window icon.
Comment 7 Claudio Saavedra 2005-11-10 18:49:39 UTC
Lucas, can you specify the size of the image that gave you that warning? I tried
to reproduce it with the eog-crasher.jpg (960x1280) and it is clean.
Comment 8 Lucas Rocha 2005-11-10 21:58:06 UTC
Did you update gtk+? I'm viewing eog-crasher.jpg too. The solution for bug
#320909 was to ignore large pixbufs as window icons and show this warning
message. EOG doesn't crash but the window icon is not set. Maybe a better
approach could be using the image thumbnail as window icon instead of the image
itself.
Comment 9 Claudio Saavedra 2005-11-11 00:00:19 UTC
Well, I cant reproduce it. I think that probably it is related to the fact of
the solution to bug #320909 implies getting GDK_SELECTION_MAX_SIZE(display) on
the fly.

Does the image thumbnail exists always? Surely in collection view we can get
every thumbnail, but I am not sure about it in single mode. I will check the
code about it.

I'll try to see how nautilus work on that, but as nautilus does have the
thumbnails always, probably it uses them for the icon.
Comment 10 Claudio Saavedra 2005-11-11 00:35:58 UTC
Created attachment 54611 [details] [review]
partial patch

I've extended EogImage API and added a eog_image_get_thumbnail() method to
retrieve the thumbnail and use it as icon. But, it currently works only in
collection mode, because in single mode the image doesn't have an icon.

To complete the patch, we should create the thumbnail even when eog is in
single image mode.
Comment 11 Claudio Saavedra 2005-11-11 18:16:47 UTC
Created attachment 54648 [details] [review]
updated patch

Forget the previous patch. I neglected the existence of a method to do exactly
the same.
Comment 12 Lucas Rocha 2005-11-13 18:27:02 UTC
Applied in HEAD. Works with the new UI. Thanks!