| Summary: | okular crashes scrolling through certain pdf | ||
|---|---|---|---|
| Product: | [Applications] okular | Reporter: | Peter Hedwig <peter.hedwig> |
| Component: | general | Assignee: | Okular developers <okular-devel> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | aacid, davidmenhur, haxtibal |
| Priority: | NOR | Keywords: | drkonqi |
| Version First Reported In: | 1.7.2 | ||
| Target Milestone: | --- | ||
| Platform: | Neon | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/kde/okular/commit/f3f7ca79fcf1ae3521ed9b7d8b586f3d45b8a487 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Peter Hedwig
2019-06-17 19:42:53 UTC
I can't cause a crash by simply scrolling. However, a crash happens reproducible when right-clicking the "Protrusion" link on left margin of page 4, using latest okular and poppler master, with backtrace as follows: Thread 1 "okular" received signal SIGSEGV, Segmentation fault. 0x00007fffe6a99989 in PageView::createProcessLinkMenu(PageViewItem*, QPoint const&) () from ./okularpart.so (gdb) bt #0 0x00007fffe6a99989 in PageView::createProcessLinkMenu(PageViewItem*, QPoint const&) () from ./okularpart.so #1 0x00007fffe6a8eaee in PageView::mouseReleaseEvent(QMouseEvent*) () from ./okularpart.so #2 0x00007ffff57a8f98 in QWidget::event(QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #3 0x00007ffff584aaee in QFrame::event(QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #4 0x00007fffe6a93a43 in PageView::viewportEvent(QEvent*) () from ./okularpart.so #5 0x00007ffff4cfa2dd in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Core.so.5 #6 0x00007ffff576a3d5 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #7 0x00007ffff5772567 in QApplication::notify(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #8 0x00007ffff4cfa558 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Core.so.5 #9 0x00007ffff5770eb2 in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #10 0x00007ffff57c4113 in ?? () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #11 0x00007ffff57c6729 in ?? () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #12 0x00007ffff576a3fc in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #13 0x00007ffff57719cf in QApplication::notify(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Widgets.so.5 #14 0x00007ffff4cfa558 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /home/tobias/kde/qt5/lib/libQt5Core.so.5 #15 0x00007ffff51033db in QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*) () from /home/tobias/kde/qt5/lib/libQt5Gui.so.5 #16 0x00007ffff5104f55 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () from /home/tobias/kde/qt5/lib/libQt5Gui.so.5 #17 0x00007ffff50ddc3b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/tobias/kde/qt5/lib/libQt5Gui.so.5 #18 0x00007fffe90a88eb in ?? () from /media/tobias/edf72459-168b-43b6-b35a-f2b198488c25/tobias/Dev/OSScontrib/kde/qt5/plugins/platforms/../../lib/libQt5XcbQpa.so.5 #19 0x00007ffff4cf888a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /home/tobias/kde/qt5/lib/libQt5Core.so.5 #20 0x00007ffff4d01a40 in QCoreApplication::exec() () from /home/tobias/kde/qt5/lib/libQt5Core.so.5 #21 0x000055555556197c in main () I'm setting this to confirmed, but note that in worst case you and me saw two unrelated issues with the same document. The problem is that Okular has bogus handling for Poppler::Link::OCGState. If a document contains such a link, we meet the case arm
case Poppler::Link::OCGState:
Q_UNREACHABLE();
This aborts Okular immediately in debug builds when scrolling to the page, or leads to construction of an Okular::ObjectRect with m_object = 0x0 in release builds, causing the crash to happen later (that's what happened in my trial from comment 2).
We either have to handle the "not implemented yet" situation more gracefully. Or create a suitable Okular::Action object to expose the feature if Okular is already capable of handling OCGState links. Didn't check what's the current state here, does anybody know?
(In reply to Tobias Deiminger from comment #2) > The problem is that Okular has bogus handling for Poppler::Link::OCGState. > If a document contains such a link, we meet the case arm > > case Poppler::Link::OCGState: > Q_UNREACHABLE(); > > This aborts Okular immediately in debug builds when scrolling to the page, > or leads to construction of an Okular::ObjectRect with m_object = 0x0 in > release builds, causing the crash to happen later (that's what happened in > my trial from comment 2). > > We either have to handle the "not implemented yet" situation more > gracefully. Or create a suitable Okular::Action object to expose the feature > if Okular is already capable of handling OCGState links. Didn't check what's > the current state here, does anybody know? That is bad, we have support for OCGState links. Let me try to see what happened. So i had a brain malfunction and when implementing this in 2016 i forgot to commit half the implementation :? Commiting in a moment Git commit f3f7ca79fcf1ae3521ed9b7d8b586f3d45b8a487 by Albert Astals Cid. Committed on 22/06/2019 at 10:35. Pushed by aacid into branch 'Applications/19.04'. Fix crash for rects that don't have an action It shouldn't really happen, but in some cases it does, so be protective M +6 -1 ui/pageview.cpp https://invent.kde.org/kde/okular/commit/f3f7ca79fcf1ae3521ed9b7d8b586f3d45b8a487 Git commit ea2a7b264f3135b9ea5f82a877c725f0b7491365 by Albert Astals Cid. Committed on 22/06/2019 at 10:36. Pushed by aacid into branch 'Applications/19.04'. PDF: Finish support for Optional Content state change links I implemented this 3 years ago, but for some reason forgot to commit this part ^_^ M +6 -1 generators/poppler/generator_pdf.cpp https://invent.kde.org/kde/okular/commit/ea2a7b264f3135b9ea5f82a877c725f0b7491365 *** Bug 409462 has been marked as a duplicate of this bug. *** |