[okular] [Bug 383915] Okular crashes with a segfault on reload for some synctex files

Henrik Fehlauer bugzilla_noreply at kde.org
Wed Nov 29 23:37:05 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=383915

--- Comment #17 from Henrik Fehlauer <rkflx at lab12.net> ---
ISSUE 1: Parse error in synctex 1.19 upstream code

Here is what I did:

Tried to make sense of where the actual upstream code is (did not succeed):
    git svn clone
svn://tug.org/texlive/trunk/Build/source/texk/web2c/synctexdir
    git clone https://github.com/jlaurens/synctex

Figured out how to build this code:
    gcc -D__SYNCTEX_WORK__ -I. synctex_main.c synctex_parser.c
synctex_parser_utils.c -lz -o synctex
    (some do not build at all, some need the "__" removed)

Figured out how to test:
    ./synctex view -i 1:1:00_00_dissertation.tex -o empty-august.pdf
1>/dev/null
    ./synctex view -i 1:1:main.tex -o empty-november.pdf 1>/dev/null

Did some bisecting:

GitHub:
    - fcbfa2c20891 fixes the crash from August, I'm positive we have this one
in the SVN version Okular pulled in.
    - The November file does not want to crash this way. However, we get
"SyncTeX ERROR: Ignored record", incidentally and sadly also since
fcbfa2c20891.

TUG:
    - August file: @44795 fixes the crash, as expected. We got this in Okular.
    - November file: Since @44795 we get "! SyncTeX Error : Ignored record
...", but no crash again. With gdb Okular does crash and we get "! SyncTeX
Error :", but "Ignored record" is only visible once poking at the "reason"
variable.

fcbfa2c20891 is titled "Nested sheet patch and other stuff", unfortunately it
is a massive code dump so we cannot see why it fixes the crash in the August
file and causes the error in the November file. @44795 seems to contain
fcbfa2c20891 together with even more changes.

Conclusion: Should be reported upstream, upgrade to the newest synctex version
once fixed there and rebase all patches :(


ISSUE 2: 04-gcc-specify-printf-format.diff

While ./synctex throws the error without crashing, Okular shows part of the
error but then crashes when trying to print the rest. It did not crash before
because the documents tested caused no error needing to be logged. It crashes
when accessing "arg" in vfprintf, because the patch to avoid "function
‘_synctex_log’ might be a candidate for ‘gnu_printf’ format attribute" was
adapted/extended wrongly.

No idea why sometimes it does not crash for Flupp, perhaps sheer luck with some
pointer access.

Conclusion: Either move some things around regarding "va_list" (i.e. add
va_start and va_end), or revert to the previous state and live with the
compiler warning for now.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list