[okular] [Bug 387247] okular [12.17beta] crash upon highlighting text in pdfs

Henrik Fehlauer bugzilla_noreply at kde.org
Tue Dec 5 20:16:20 UTC 2017


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

--- Comment #17 from Henrik Fehlauer <rkflx at lab12.net> ---
For both documents, I can now reproduce the crash pretty reliably:
- Add highlighting annotation.
- Save document. (← This is an essential prerequisite.)
- Scroll to a new page to trigger rendering (← Somehow this is needed to get in
a bad state, but only for the first document.)
- Keep adding more highlighting annotations and scrolling further until the
crash triggers (it won't always crash for the first one).

(IOW, it's important to be as detailed as possible when reporting a bug and
when requesting information from a bug reporter, otherwise it's just plain
guessing…)

In fact, even with autotests/data/file1.pdf a crash is now trivial to trigger
(highlight → save → highlight). I bisected back and forth in both Okular and
Poppler, and ultimately Okular's ca5422d0e9ad ("Implement swapBackingFile for
the PDF backend") is the culprit (tested with Poppler master). The only
explanation I have is that the new annotation saving feature was mainly tested
with the pen tool, but less so with the highlighter, which was not wise reading
that commit message now.

Albert: Backtrace is the same as above, let me know if you still cannot
reproduce and need the Valgrind log. Removing "qDeleteAll( pagePrivatesToDelete
)" fixes the crash for me, because then accessing "d" in "Page::width" won't
segfault anymore. However, now "d" leaks obviously. Any tips on how the
oldPage/newPage pointer swapping is supposed to work and the leak could be
prevented?

Otherwise, I'd say leaking a little bit is better than crashing, given that the
final release is tomorrow…

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


More information about the Okular-devel mailing list