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 630845 - synctex_backward_search causes segfault (SIGSEGV)
synctex_backward_search causes segfault (SIGSEGV)
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: backends
2.32.x
Other Linux
: Normal critical
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-28 19:39 UTC by Peter B. Jørgensen
Modified: 2010-09-30 15:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fixing the issue (1.48 KB, patch)
2010-09-29 16:25 UTC, José Aliste
committed Details | Review

Description Peter B. Jørgensen 2010-09-28 19:39:47 UTC
Running beta release of ubuntu 2010-09-28 in virtualbox, ctrl-clicking in synctex-enabled pdf document causes evince to segfault.

Here is the gdb stacktrace:
----------------- Start of GDB output -------------------------
gdb evince
GNU gdb (GDB) 7.2-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/bin/evince...
warning: the debug information found in "/usr/lib/debug//usr/bin/evince" does not match "/usr/bin/evince" (CRC mismatch).


warning: the debug information found in "/usr/lib/debug/usr/bin/evince" does not match "/usr/bin/evince" (CRC mismatch).

(no debugging symbols found)...done.
(gdb) run main.pdf
Starting program: /usr/bin/evince main.pdf
[Thread debugging using libthread_db enabled]
[New Thread 0x7f192c20f710 (LWP 1671)]
[New Thread 0x7f192ba0e710 (LWP 1672)]
[New Thread 0x7f192b20d710 (LWP 1673)]
[New Thread 0x7f19298a7710 (LWP 1674)]
[New Thread 0x7f192378c710 (LWP 1675)]
[Thread 0x7f192ba0e710 (LWP 1672) exited]
[Thread 0x7f192b20d710 (LWP 1673) exited]

(evince:1668): GLib-CRITICAL **: g_variant_new_string: assertion `string != NULL' failed

Program received signal SIGSEGV, Segmentation fault.
0x00007f1932312560 in ?? () from /lib/libglib-2.0.so.0
(gdb) backtrace
  • #0 ??
    from /lib/libglib-2.0.so.0
  • #1 g_variant_builder_add_value
    from /lib/libglib-2.0.so.0
  • #2 ??
    from /lib/libglib-2.0.so.0
  • #3 g_variant_new_va
    from /lib/libglib-2.0.so.0
  • #4 g_variant_new
    from /lib/libglib-2.0.so.0
  • #5 ??
  • #6 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #7 ??
    from /usr/lib/libgobject-2.0.so.0
  • #8 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #9 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #10 ev_view_synctex_backward_search
    at /build/buildd/evince-2.32.0/./libview/ev-view.c line 2936
  • #11 ev_view_button_press_event
    at /build/buildd/evince-2.32.0/./libview/ev-view.c line 3555
  • #12 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #13 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #14 ??
    from /usr/lib/libgobject-2.0.so.0
  • #15 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #16 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #17 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #18 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #19 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #20 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #21 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #22 ??
    from /lib/libglib-2.0.so.0
  • #23 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #24 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #25 main

Comment 1 José Aliste 2010-09-28 20:05:02 UTC
Thanks for reporting this. I can't reproduce the crash. 

Does it happen with every synctex-enabled pdf file? Does it happen every time you ctrl-click in Evince?
Comment 2 Peter B. Jørgensen 2010-09-29 15:34:28 UTC
It doesnt happen everytime in every synctex-enabled pdf file. It happens only in some areas of the pdf file. Maybe it's when synctex fails to find the source file.

This pdf-file can generate the crash.
http://dl.dropbox.com/u/198449/main.pdf
http://dl.dropbox.com/u/198449/main.synctex.gz
(I had to put it on dropbox, because the files are too big for an attachment)

Steps to reproduce:
Download main.pdf and main.synctex.gz to the same folder.
Open main.pdf in evince and go to page label 43 (absolute page 53) and ctrl-click the text and you should get a crash.
Comment 3 José Aliste 2010-09-29 15:48:48 UTC
Peter, 

Thanks you for the useful files and steps to reproduce. I get the crash now, so hopefully I will attach a patch soon.
Comment 4 José Aliste 2010-09-29 16:25:11 UTC
Created attachment 171345 [details] [review]
patch fixing the issue

The attached patch fixes the crash. The patch is done to be applied to the gnome-2-32 branch.

More info about the issue. I was assuming that the synctex parser ALWAYS return an input_file + line + col when you do a backward_search. In test case provided, this is not true, and this is an issue in the synctex parser itself. So it would be good if you could forward the issue  to synctex developer. (just try to do synctex -o 52:300:200:main.pdf in your file to see that the synctex parser does not perform the backward search).
Comment 5 José Aliste 2010-09-30 15:35:17 UTC
Review of attachment 171345 [details] [review]:

Pushed to gnome-2-32 and master branches.
Comment 6 José Aliste 2010-09-30 15:36:16 UTC
Peter, thanks for reporting, the fix will be available in the next release of Evince.