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 737197 - Crashes on right click with cbz document
Crashes on right click with cbz document
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
3.13.x
Other Linux
: Normal critical
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-09-23 16:33 UTC by Eddy Castillo
Modified: 2014-09-26 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
shell: Check if doc implements Annotations interface before cast (1.18 KB, patch)
2014-09-25 20:04 UTC, José Aliste
committed Details | Review

Description Eddy Castillo 2014-09-23 16:33:41 UTC
Doing right click on a page of a cbz document produces a segmentation fault.

Steps to reproduce:
1) Open a cbz file.
2) Right click on any page.

Details:
evince-3.13.92-1.fc21.x86_64
File (but it occurs with any other cbz file):
https://www.dropbox.com/s/qrsfojsgi6w6ysn/oyasumi_punpun_v01_c001.cbz?dl=0

Traces:
(evince:21443): GLib-GObject-WARNING **: invalid cast from 'ComicsDocument' to 'EvDocumentAnnotations'

Program received signal SIGSEGV, Segmentation fault.
ev_document_annotations_can_remove_annotation (document_annots=0x7fffdc0b5b20)
    at ev-document-annotations.c:92
92		return iface->remove_annotation != NULL;

(gdb) thread apply all bt full

Thread 1 (Thread 0x7ffff7fba980 (LWP 21443))

  • #0 ev_document_annotations_can_remove_annotation
    at ev-document-annotations.c line 92
  • #1 view_menu_annot_popup
    at ev-window.c line 5055
  • #2 view_menu_popup_cb
    at ev-window.c line 5098
  • #3 g_cclosure_marshal_VOID__POINTERv
    at gmarshal.c line 1236
  • #4 _g_closure_invoke_va
    at gclosure.c line 831
  • #5 g_signal_emit_valist
    at gsignal.c line 3218
  • #6 g_signal_emit
    at gsignal.c line 3365
  • #7 ev_view_do_popup_menu
    at ev-view.c line 4468
  • #8 ev_view_button_press_event
  • #9 _gtk_marshal_BOOLEAN__BOXEDv
    at gtkmarshalers.c line 130
  • #10 _g_closure_invoke_va
    at gclosure.c line 831
  • #11 g_signal_emit_valist
    at gsignal.c line 3218
  • #12 g_signal_emit
    at gsignal.c line 3365
  • #13 gtk_widget_event_internal
    at gtkwidget.c line 7773
  • #14 propagate_event_up
    at gtkmain.c line 2414
  • #15 propagate_event
    at gtkmain.c line 2522
  • #16 gtk_main_do_event
    at gtkmain.c line 1748
  • #17 gdk_event_source_dispatch
    at gdkeventsource.c line 364
  • #18 g_main_dispatch
    at gmain.c line 3064
  • #19 g_main_context_dispatch
    at gmain.c line 3663
  • #20 g_main_context_iterate
    at gmain.c line 3734
  • #21 g_main_context_iteration
  • #22 g_application_run
    at gapplication.c line 2282
  • #23 main
    at main.c line 316

Comment 1 José Aliste 2014-09-25 20:04:39 UTC
Created attachment 287109 [details] [review]
shell: Check if doc implements Annotations interface before cast

Without this check, evince will crash when a right-click
on a non-pdf document is performed.
Comment 2 Carlos Garcia Campos 2014-09-26 12:43:10 UTC
Review of attachment 287109 [details] [review]:

Thanks!

::: shell/ev-window.c
@@ +5056,3 @@
+		can_remove_annots = ev_document_annotations_can_remove_annotation (EV_DOCUMENT_ANNOTATIONS (ev_window->priv->document));
+	else
+		can_remove_annots = FALSE;

Good catch! Please, initialize the variable to FALSE when declared and remove the else branch.
Comment 3 José Aliste 2014-09-26 12:49:53 UTC
pushed to master. Thanks for reporting