Page MenuHomeSolus

Okular document viewer crashes (apparently due to missing dependency?)
Closed, ResolvedPublic

Description

#SUMMARY
Saving a PDF file with the Okular document viewer randomly crashes the application (on Budgie desktop).

Software VERSIONS
Okular is on version 1.8.0, KDE Frameworks 5.62.0, Qt 5.13.1

#STEPS TO REPRODUCE

  1. Open PDF file with Okular.
  2. Make changes to the file (in my case: filling out forms and adding annotations)
  3. Save the file.

#OBSERVED RESULTS
Running "okular /path/to/my/document.pdf" from the terminal gives me warnings about missing icons and plugins (non-issues, I guess)

`Icon theme "breeze" not found.
Icon theme "gnome" not found.
Icon theme "breeze" not found.
Icon theme "gnome" not found.
discarding "Send SMS via KDE Connect" ("ShareUrl")`

When trying to save a PDF file, Okular crashes completely and I get the following in the terminal:

`Couldn't start kuiserver from org.kde.kuiserver.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kuiserver was not provided by any .service files")
Segmentation fault`

Unfortunately, I'm unable to reproduce the error consistently. It seems to happen mostly with signed documents from my university, which leads me to believe it might be those documents' structure. I'm unable to upload them here for privacy reasons. However, I've worked on these kinds of documents before in the same fashion and Okular hasen't given me any problems at all. This problem seems to have started only after I installed last Friday's updates which upgraded a bunch of kde-specific libraries, if I remember correctly (Sept. 20th 2019)

#ADDENDUM

  1. This problem does not occur on my KDE neon machine.
  2. Here are some random test files which throw the same error but do NOT crash the application.

Signature_Test_Form.pdf
Request for grant of a European patent
PDF Form Example

Event Timeline

joebonrichie added a subscriber: joebonrichie.

If you are unable to provide specific documents that cause the crash please provide a backtrace instead. To do this;

Install debugger and debug symbols
sudo eopkg it gdb okular-dbginfo

Run the program via gdb
gdb okular

Then, within gdb type in run to start okular. Use the program as normal to produce the crash. When it crashes enter backtrace in gdb and post the output here.

Thank you for the easy to follow guide, joebonrichie!

This is the backtrace I get, but it might not be useful.

(gdb) backtrace
#0  0x00007fffdc001d70 in PL_HashTableLookupConst () at /usr/lib/libplds4.so
#1  0x00007fffbde5c2d8 in SECOID_FindOID_Util () at /usr/lib/libnssutil3.so
#2  0x00007fffcc078ae9 in NSS_CMSContentInfo_GetContentTypeTag ()
    at /usr/lib/libsmime3.so
#3  0x00007fffcc079c70 in  () at /usr/lib/libsmime3.so
#4  0x00007fffbde5847e in SEC_ASN1DecoderUpdate_Util ()
    at /usr/lib/libnssutil3.so
#5  0x00007fffcc079a9b in NSS_CMSDecoder_Update () at /usr/lib/libsmime3.so
#6  0x00007fffcc07a29d in NSS_CMSMessage_CreateFromDER ()
    at /usr/lib/libsmime3.so
#7  0x00007fffcc5ab6b3 in SignatureHandler::CMS_MessageCreate(SECItemStr*) ()
    at /usr/lib/libpoppler.so.86
dwarf2read.c:9715: internal-error: void dw2_add_symbol_to_list(symbol*, pending**): Assertion `(*listhead) == NULL || (SYMBOL_LANGUAGE ((*listhead)->symbol[0]) == SYMBOL_LANGUAGE (symbol))' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) y

This is a bug, please report it.  For instructions, see:
<http://www.gnu.org/software/gdb/bugs/>.

dwarf2read.c:9715: internal-error: void dw2_add_symbol_to_list(symbol*, pending**): Assertion `(*listhead) == NULL || (SYMBOL_LANGUAGE ((*listhead)->symbol[0]) == SYMBOL_LANGUAGE (symbol))' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.

Ending the backtracing session, gdb tells me it's Unable to dump core, use ulimit -c unlimited' before executing GDB next time. However, I find myself unable to do this.

  • I tried the command as shown (which tells me I don't have permission, using sudo or not)
  • Using ulimit -S -c unlimited gdb seems to work but results in the same error/warning.
  • I also tried to change the value globally in etc/security/limits.conf, but this seems to be ignored or not the right place for doing so.

So, apologies if the above backtrace is insufficient, but I guess I need further assistance with ulimit in order to provide a more useful output.

So, in addition, you seem to be running up against a problem with gdb itself unrelated to okular, unluckily for you, as evidenced by https://bugzilla.redhat.com/show_bug.cgi?id=1560010. I'll have to update gdb first to resolve it, so you'll have to bear with me a couple of days. Apologies for the inconvenience!

Alright, i've updated gdb, can you try to manually install the new gdb from unstable by running;

sudo eopkg it https://packages.getsol.us/unstable/g/gdb/gdb-8.3.1-11-1-x86_64.eopkg

And try obtaining a backtrace once again? This new gdb version should fix the internal problem with gdb you were running into.

Thank you for your time and prompt reaction, joebonrichie! =)
I've upgraded gdb, here's the output. I'v eincluded the run part as well, just in case there's something of interest in there as well.

(gdb) run

Starting program: /usr/bin/okular 
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.27-gdb.py", line 60, in <module>
    from libstdcxx.v6 import register_libstdcxx_printers
ImportError: No module named libstdcxx.v6
warning: File "/usr/lib64/libthread_db-1.0.so" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
	add-auto-load-safe-path /usr/lib64/libthread_db-1.0.so
line to your configuration file "/home/szb/.gdbinit".
To completely disable this security protection add
	set auto-load safe-path /
line to your configuration file "/home/szb/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
	info "(gdb)Auto-loading safe path"
warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available.
[New LWP 2084]
[New LWP 2085]
Icon theme "breeze" not found.
Icon theme "gnome" not found.
[New LWP 2087]
[New LWP 2088]
[New LWP 2089]
Icon theme "breeze" not found.
Icon theme "gnome" not found.
[New LWP 2090]
[New LWP 2091]
[New LWP 2092]
[New LWP 2093]
[New LWP 2094]
[LWP 2093 exited]
[LWP 2092 exited]
[LWP 2091 exited]
discarding "Send SMS via KDE Connect" ("ShareUrl")
[Detaching after fork from child process 2095]
[New LWP 2097]
[New LWP 2098]
[LWP 2097 exited]
[New LWP 2099]
[LWP 2098 exited]
[LWP 2099 exited]
[New LWP 2100]
[LWP 2100 exited]
[New LWP 2101]
[New LWP 2102]
[LWP 2101 exited]
[LWP 2102 exited]
[New LWP 2103]
[LWP 2103 exited]
[New LWP 2104]
[LWP 2104 exited]
[New LWP 2105]
[New LWP 2106]
[LWP 2105 exited]
[LWP 2106 exited]
[New LWP 2107]
[LWP 2107 exited]
[New LWP 2108]
[LWP 2108 exited]
[New LWP 2109]
[New LWP 2110]
[LWP 2109 exited]
[LWP 2110 exited]
[LWP 2090 exited]
[New LWP 2112]
[New LWP 2113]
[LWP 2112 exited]
[LWP 2113 exited]
[New LWP 2115]
[LWP 2115 exited]
[New LWP 2116]
[LWP 2116 exited]
[New LWP 2119]
[New LWP 2120]
[LWP 2119 exited]
[LWP 2120 exited]
[New LWP 2133]
[New LWP 2134]
[LWP 2133 exited]
[LWP 2134 exited]
[New LWP 2135]
[LWP 2135 exited]
[New LWP 2136]
[LWP 2136 exited]
Couldn't start kuiserver from org.kde.kuiserver.service: QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.kde.kuiserver was not provided by any .service files")
[Detaching after fork from child process 2137]
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)

Thread 1 "okular" received signal SIGSEGV, Segmentation fault.
0x00007fffdc001d70 in PL_HashTableLookupConst () from /usr/lib/libplds4.so

(gdb) backtrace

#0  0x00007fffdc001d70 in PL_HashTableLookupConst () at /usr/lib/libplds4.so
#1  0x00007fffbe42d2d8 in SECOID_FindOID_Util () at /usr/lib/libnssutil3.so
#2  0x00007fffbe621ae9 in NSS_CMSContentInfo_GetContentTypeTag ()
    at /usr/lib/libsmime3.so
#3  0x00007fffbe622c70 in  () at /usr/lib/libsmime3.so
#4  0x00007fffbe42947e in SEC_ASN1DecoderUpdate_Util ()
    at /usr/lib/libnssutil3.so
#5  0x00007fffbe622a9b in NSS_CMSDecoder_Update () at /usr/lib/libsmime3.so
#6  0x00007fffbe62329d in NSS_CMSMessage_CreateFromDER ()
    at /usr/lib/libsmime3.so
#7  0x00007fffcc3746b3 in SignatureHandler::CMS_MessageCreate(SECItemStr*) ()
    at /usr/lib/libpoppler.so.86
#8  0x00007fffcc375737 in SignatureHandler::SignatureHandler(unsigned char*, int) () at /usr/lib/libpoppler.so.86
#9  0x00007fffcc2688e6 in FormFieldSignature::validateSignature(bool, bool, long) () at /usr/lib/libpoppler.so.86
#10 0x00007fffcc4825f5 in Poppler::FormFieldSignature::validate(int, QDateTime const&) const () at /usr/lib/libpoppler-qt5.so.1
#11 0x00007fffcc4830ff in Poppler::FormFieldSignature::validate(Poppler::FormFieldSignature::ValidateOptions) const () at /usr/lib/libpoppler-qt5.so.1
#12 0x00007fffdc043057 in PopplerFormFieldSignature::PopplerFormFieldSignature(Poppler::FormFieldSignature*) (field=0xf0cf50, this=0xf03540)
    at ../generators/poppler/formfields.cpp:387
--Type <RET> for more, q to quit, c to continue without paging--c
#13 0x00007fffdc043057 in PDFGenerator::addFormFields(Poppler::Page*, Okular::Page*) (this=<optimized out>, page=<optimized out>, popplerPage=<optimized out>) at ../generators/poppler/generator_pdf.cpp:1977
#14 0x00007fffdc043057 in PDFGenerator::loadPages(QVector<Okular::Page*>&, int, bool) (rotation=0, clear=false, pagesVector=..., this=0xf0cf50) at ../generators/poppler/generator_pdf.cpp:781
#15 0x00007fffdc043057 in PDFGenerator::init(QVector<Okular::Page*>&, QString const&) (this=this@entry=0xea0e70, pagesVector=..., password=...) at ../generators/poppler/generator_pdf.cpp:677
#16 0x00007fffdc043698 in PDFGenerator::loadDocumentWithPassword(QString const&, QVector<Okular::Page*>&, QString const&) (this=0xea0e70, filePath=..., pagesVector=..., password=...) at ../generators/poppler/generator_pdf.cpp:632
#17 0x00007fffdc044370 in PDFGenerator::swapBackingFile(QString const&, QVector<Okular::Page*>&) (this=0xea0e70, newFileName=..., newPagesVector=...) at /usr/include/QtCore/qarraydata.h:257
#18 0x00007fffe40f2a63 in Okular::Document::swapBackingFile(QString const&, QUrl const&) (url=..., newFileName=..., this=0x7488c0) at ../core/document.cpp:4603
#19 0x00007fffe40f2a63 in Okular::Document::swapBackingFile(QString const&, QUrl const&) (this=this@entry=0x7488c0, newFileName=..., url=...) at ../core/document.cpp:4590
#20 0x00007fffe4286f80 in Okular::Part::doOpenFile(QMimeType const&, QString const&, bool*) (this=this@entry=0x6e5800, mimeA=..., fileNameToOpenA=..., isCompressedFile=isCompressedFile@entry=0x7fffffffcec7) at ../part.cpp:1413
#21 0x00007fffe428989b in Okular::Part::openFile() (this=0x6e5800) at ../part.cpp:1565
#22 0x00007ffff7fa031c in  () at /usr/lib/libKF5Parts.so.5
#23 0x00007ffff7fa0b7f in KParts::ReadOnlyPart::openUrl(QUrl const&) () at /usr/lib/libKF5Parts.so.5
#24 0x00007fffe4288f76 in Okular::Part::openUrl(QUrl const&, bool) (this=0x6e5800, _url=..., swapInsteadOfOpening=<optimized out>) at ../part.cpp:1772
#25 0x00007fffe428468f in Okular::Part::saveAs(QUrl const&, QFlags<Okular::Part::SaveAsFlag>) (this=0x6e5800, saveUrl=..., flags=...) at ../part.cpp:2828
#26 0x00007fffe427d15d in Okular::Part::saveFile() (this=0x6e5800) at ../part.cpp:2522
#27 0x00007fffe427d15d in Okular::Part::saveFile() (this=0x6e5800) at ../part.cpp:2517
#28 0x00007ffff6573048 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#29 0x00007ffff6fe2f92 in QAction::triggered(bool) () at /usr/lib/libQt5Widgets.so.5
#30 0x00007ffff6fe5682 in QAction::activate(QAction::ActionEvent) () at /usr/lib/libQt5Widgets.so.5
#31 0x00007ffff6fe5f1f in QAction::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#32 0x00007ffff6fe9382 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#33 0x00007ffff6ff28c0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#34 0x00007ffff6547f82 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#35 0x00007ffff69faa9e in QShortcutMap::dispatchEvent(QKeyEvent*) () at /usr/lib/libQt5Gui.so.5
#36 0x00007ffff69fab7b in QShortcutMap::tryShortcut(QKeyEvent*) () at /usr/lib/libQt5Gui.so.5
#37 0x00007ffff69b05ee in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) () at /usr/lib/libQt5Gui.so.5
#38 0x00007ffff69ccf3d in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) () at /usr/lib/libQt5Gui.so.5
#39 0x00007ffff69d2361 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /usr/lib/libQt5Gui.so.5
#40 0x00007fffe44daaef in  () at /usr/lib64/qt5/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so
#41 0x00007ffff6573048 in QMetaObject::activate(QObject*, int, int, void**) () at /usr/lib/libQt5Core.so.5
#42 0x00007ffff688de4f in QDBusPendingCallWatcher::finished(QDBusPendingCallWatcher*) () at /usr/lib/libQt5DBus.so.5
#43 0x00007ffff688df50 in  () at /usr/lib/libQt5DBus.so.5
#44 0x00007ffff65738fa in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#45 0x00007ffff6fe9382 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#46 0x00007ffff6ff28c0 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#47 0x00007ffff6547f82 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /usr/lib/libQt5Core.so.5
#48 0x00007ffff654ac18 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () at /usr/lib/libQt5Core.so.5
#49 0x00007ffff659ed63 in  () at /usr/lib/libQt5Core.so.5
#50 0x00007ffff34a442e in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#51 0x00007ffff34a46c8 in  () at /usr/lib/libglib-2.0.so.0
#52 0x00007ffff34a475c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#53 0x00007ffff659e3a1 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#54 0x00007ffff6546aeb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /usr/lib/libQt5Core.so.5
#55 0x00007ffff654e752 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#56 0x000000000040d90d in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at ../shell/main.cpp:90

I hope this is useful in some way, please let me know if I can be of further assistance!

*On a side note: After upgrading gdb, I rebooted the system, just to make sure the upgrade would take. Although I can't confirm this (or can I?) the laptop seemed to have trouble rebooting. It appeared to be stuck on the manufacturer's logo for about 20-30 seconds (whereas usually I see that for about 2-3 seconds).

After this first attempt, without lightdm coming on, the laptop rebooted once again on its own and the boot sequence was as quick as ever. However, after login, I noticed some of my tray icons "jittering", for a lack of better words. They were jumping in and out of place ever so slightly, but normalized when I hovered over them with the mouse cursor. I rebooted the machine again, just to see if this reappeared, and everything's as it should be, so it seems to have been a one-time glitch. But perhaps this is of interest to you as well.

I think i've found the issue; https://gitlab.freedesktop.org/poppler/poppler/issues/766. We'll have to update poppler to at least version 0.77 to resolve this issue. When poppler is updated all reverse dependencies need to be rebuilt against the new version so it'll take a while, especially as Josh is in the middle of performing a GNOME stack upgrade right now. As an interim solution you could try installing the snap or flatpak version of okular, or using the a different pdf viewer.

Also thanks for being prompt with providing the backtrace, makes my life easier!

As for that strange reboot issue you had, i'm not really sure, could just well be graphics drivers being derpy, I don't see how gdb could cause that

Thank you very much for looking into this!
Your way of explaining things and guiding me through it makes me feel as if even a noob like me can contribute in some small fashion. I really appreciate it!