Bug 381328 - Okular crashes when editing forms in a PDF that's located inside an archive
Summary: Okular crashes when editing forms in a PDF that's located inside an archive
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 1.0.0
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2017-06-17 13:03 UTC by sedrubal
Modified: 2020-12-02 09:21 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
An example zip with pdf with forms (106.42 KB, application/zip)
2017-06-17 13:05 UTC, sedrubal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sedrubal 2017-06-17 13:03:25 UTC
Application: ark (16.12.3)

Qt Version: 5.7.1
Frameworks Version: 5.35.0
Operating System: Linux 4.11.4-300.fc26.x86_64 x86_64
Distribution (Platform): Fedora RPMs

-- Information about the crash:
- What I was doing when the application crashed:

I opened a tar.xz (but this happenes with every archive), opened a PDF with forms using the okular preview, displayed the forms inside this PDF, edited some forms and closed okular.

The crash can be reproduced every time.

-- Backtrace:
Application: Ark (ark), signal: Aborted
Using host libthread_db library "/lib64/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f5407c258c0 (LWP 18013))]

Thread 3 (Thread 0x7f53f0a42700 (LWP 18015)):
#0  0x00007f540a97d589 in g_mutex_lock () at /lib64/libglib-2.0.so.0
#1  0x00007f540a937b06 in g_main_context_prepare () at /lib64/libglib-2.0.so.0
#2  0x00007f540a9384cb in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#3  0x00007f540a9386ac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#4  0x00007f54116d6d0b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#5  0x00007f5411686b8a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#6  0x00007f54114dbefa in QThread::exec() () at /lib64/libQt5Core.so.5
#7  0x00007f54128b1709 in QDBusConnectionManager::run() () at /lib64/libQt5DBus.so.5
#8  0x00007f54114e01ee in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#9  0x00007f540f29636d in start_thread () at /lib64/libpthread.so.0
#10 0x00007f54108c6e9f in clone () at /lib64/libc.so.6

Thread 2 (Thread 0x7f53fc8f4700 (LWP 18014)):
#0  0x00007f54108badad in poll () at /lib64/libc.so.6
#1  0x00007f540a02ec97 in _xcb_conn_wait () at /lib64/libxcb.so.1
#2  0x00007f540a030a8a in xcb_wait_for_event () at /lib64/libxcb.so.1
#3  0x00007f5400f93b99 in QXcbEventReader::run() () at /lib64/libQt5XcbQpa.so.5
#4  0x00007f54114e01ee in QThreadPrivate::start(void*) () at /lib64/libQt5Core.so.5
#5  0x00007f540f29636d in start_thread () at /lib64/libpthread.so.0
#6  0x00007f54108c6e9f in clone () at /lib64/libc.so.6

Thread 1 (Thread 0x7f5407c258c0 (LWP 18013)):
[KCrash Handler]
#6  0x00007f54107ec64b in raise () at /lib64/libc.so.6
#7  0x00007f54107ee450 in abort () at /lib64/libc.so.6
#8  0x00007f53defc15c8 in FormFieldText::setContentCopy(GooString*) () at /lib64/libpoppler.so.66
#9  0x00007f53df3ce2b4 in Poppler::FormFieldText::setText(QString const&) () at /lib64/libpoppler-qt5.so.1
#10 0x00007f53e56c1841 in Okular::EditFormTextCommand::redo() () at /lib64/libOkular5Core.so.7
#11 0x00007f5412249468 in QUndoStack::push(QUndoCommand*) () at /lib64/libQt5Widgets.so.5
#12 0x00007f53e56a147f in Okular::Document::editFormText(int, Okular::FormFieldText*, QString const&, int, int, int) () at /lib64/libOkular5Core.so.7
#13 0x00007f53e59f087d in QtPrivate::QSlotObject<void (Okular::Document::*)(int, Okular::FormFieldText*, QString const&, int, int, int), QtPrivate::List<int, Okular::FormFieldText*, QString const&, int, int, int>, void>::impl(int, QtPrivate::QSlotObjectBase*, QObject*, void**, bool*) () at /usr/lib64/qt5/plugins/okularpart.so
#14 0x00007f54116af4b7 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#15 0x00007f53e59e9110 in TextAreaEdit::slotChanged() () at /usr/lib64/qt5/plugins/okularpart.so
#16 0x00007f54116af4b7 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#17 0x00007f5412080345 in QTextEdit::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () at /lib64/libQt5Widgets.so.5
#18 0x00007f54116af383 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#19 0x00007f54120a3f35 in QWidgetTextControl::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) () at /lib64/libQt5Widgets.so.5
#20 0x00007f54120a5805 in QWidgetTextControl::qt_metacall(QMetaObject::Call, int, void**) () at /lib64/libQt5Widgets.so.5
#21 0x00007f54116af46c in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#22 0x00007f5411abee14 in QTextDocumentPrivate::finishEdit() () at /lib64/libQt5Gui.so.5
#23 0x00007f5411afb901 in QSyntaxHighlighter::setDocument(QTextDocument*) () at /lib64/libQt5Gui.so.5
#24 0x00007f5411afba29 in QSyntaxHighlighter::~QSyntaxHighlighter() () at /lib64/libQt5Gui.so.5
#25 0x00007f54123f9c49 in Sonnet::Highlighter::~Highlighter() () at /lib64/libKF5SonnetUi.so.5
#26 0x00007f54116b5a88 in QObjectPrivate::deleteChildren() () at /lib64/libQt5Core.so.5
#27 0x00007f54116b6962 in QObject::~QObject() () at /lib64/libQt5Core.so.5
#28 0x00007f5414595053 in KTextDecorator::~KTextDecorator() () at /lib64/libKF5TextWidgets.so.5
#29 0x00007f541458fe7b in KTextEdit::~KTextEdit() () at /lib64/libKF5TextWidgets.so.5
#30 0x00007f53e59f0392 in non-virtual thunk to TextAreaEdit::~TextAreaEdit() () at /usr/lib64/qt5/plugins/okularpart.so
#31 0x00007f53e5a30eef in PageViewItem::~PageViewItem() () at /usr/lib64/qt5/plugins/okularpart.so
#32 0x00007f53e5a1e26d in PageView::notifySetup(QVector<Okular::Page*> const&, int) () at /usr/lib64/qt5/plugins/okularpart.so
#33 0x00007f53e56b3ef2 in Okular::Document::closeDocument() () at /lib64/libOkular5Core.so.7
#34 0x00007f53e59b515b in Okular::Part::closeUrl(bool) () at /usr/lib64/qt5/plugins/okularpart.so
#35 0x00007f53eb3c96d8 in ArkViewer::dialogClosed() () at /usr/lib64/qt5/plugins/arkpart.so
#36 0x00007f54116af4b7 in QMetaObject::activate(QObject*, int, int, void**) () at /lib64/libQt5Core.so.5
#37 0x00007f54120c690e in QDialog::finished(int) () at /lib64/libQt5Widgets.so.5
#38 0x00007f54120c7168 in QDialog::done(int) () at /lib64/libQt5Widgets.so.5
#39 0x00007f54120c6ae6 in QDialog::closeEvent(QCloseEvent*) () at /lib64/libQt5Widgets.so.5
#40 0x00007f5411f21af0 in QWidget::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#41 0x00007f5411edad9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#42 0x00007f5411ee23d4 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#43 0x00007f5411687b8b in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#44 0x00007f5411f1d1f1 in QWidgetPrivate::close_helper(QWidgetPrivate::CloseMode) () at /lib64/libQt5Widgets.so.5
#45 0x00007f5411f3c810 in QWidgetWindow::handleCloseEvent(QCloseEvent*) () at /lib64/libQt5Widgets.so.5
#46 0x00007f5411f3f9a6 in QWidgetWindow::event(QEvent*) () at /lib64/libQt5Widgets.so.5
#47 0x00007f5411edad9c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#48 0x00007f5411ee23d4 in QApplication::notify(QObject*, QEvent*) () at /lib64/libQt5Widgets.so.5
#49 0x00007f5411687b8b in QCoreApplication::notifyInternal2(QObject*, QEvent*) () at /lib64/libQt5Core.so.5
#50 0x00007f54119be492 in QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::CloseEvent*) () at /lib64/libQt5Gui.so.5
#51 0x00007f54119c2b95 in QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*) () at /lib64/libQt5Gui.so.5
#52 0x00007f54119a119b in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Gui.so.5
#53 0x00007f5400fc7590 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /lib64/libQt5XcbQpa.so.5
#54 0x00007f540a938277 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
#55 0x00007f540a938618 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
#56 0x00007f540a9386ac in g_main_context_iteration () at /lib64/libglib-2.0.so.0
#57 0x00007f54116d6cef in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#58 0x00007f5411686b8a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () at /lib64/libQt5Core.so.5
#59 0x00007f541168e7dc in QCoreApplication::exec() () at /lib64/libQt5Core.so.5
#60 0x000055dc8ae06fde in main ()

Reported using DrKonqi
Comment 1 sedrubal 2017-06-17 13:05:16 UTC
Created attachment 106141 [details]
An example zip with pdf with forms
Comment 2 Nate Graham 2017-06-17 13:29:56 UTC
Confirmed with Okular 1.0.3, Ark 16.12.3, in Kubuntu 17.0.4.

After editing the form, you just close Okular; don't save first. This also reproduces when bypassing Ark entirely and opening the PDF from within Dolphin, when viewing the archive as a folder. Moving to Okular.
Comment 3 null 2017-11-26 23:02:27 UTC
Testing with KDE Applications 17.12 Beta via "okular zip:/home/user/form_english.zip/form_english.pdf", Okular still crashes, but at least we get an error beforehand which makes sense: "Error: 'Writing to zip is not supported.'. Try to save it to another location." I can confirm that saving to another location does work correctly.

There are still two problems here:
- Okular should not crash afterwards.
- Why doesn't Okular support saving to zip:/, isn't this just another kioslave like fish:/ (which works fine with annotations)?
Comment 4 Albert Astals Cid 2018-03-04 00:00:52 UTC
Henrik where did you get a zip ioslave from?
Comment 5 null 2018-03-04 07:08:51 UTC
Would "protocol" be a more appropriate terminology? Regardless, let's focus on the crash in this bug.
Comment 6 Albert Astals Cid 2018-03-04 10:15:44 UTC
(In reply to Henrik Fehlauer from comment #5)
> Would "protocol" be a more appropriate terminology? 

No. (Since you said to focus on the bug i won't explain here why, if you're interesed in reasons we can have a private discussion over email/irc/whatever)
Comment 7 Albert Astals Cid 2018-03-07 19:39:35 UTC
So are you going to tell me where i can find the zip ioslave so i can try to fix this bug or what?
Comment 8 null 2018-03-07 19:55:52 UTC
Just tried it again on a standard Plasma installation with Okular 1.3.2:
- okular zip:/home/user/form_english.zip/form_english.pdf
- Entered text into the form
- Closed Okular (chose to discard)
- Aborted (core dumped)
Comment 9 Albert Astals Cid 2018-03-08 17:33:28 UTC
Ok, since Henrik didn't seem to want to answer my question i'll answer myself, the kio ioslave comes with kio-extras
Comment 10 null 2018-03-08 19:32:32 UTC
(OT)

> since Henrik didn't seem to want to answer my question
What? I always try to answer questions in the best way possible. In fact, I specified where my way of accessing the zip file came from: "a standard Plasma installation". If you are looking for the name of the repository the particular code responsible for that functionality lives in, you should put that in your original (or follow-up) question. Don't just assume I built it from source and then blame me for not getting you the answer you looked for.
Comment 11 Albert Astals Cid 2018-04-23 20:19:01 UTC
(In reply to Henrik Fehlauer from comment #10)
> (OT)
> 
> > since Henrik didn't seem to want to answer my question
> What? I always try to answer questions in the best way possible. In fact, I
> specified where my way of accessing the zip file came from: "a standard
> Plasma installation". If you are looking for the name of the repository the
> particular code responsible for that functionality lives in, you should put
> that in your original (or follow-up) question. Don't just assume I built it
> from source and then blame me for not getting you the answer you looked for.

Don't be pedantic, it's not smart.

I clearly said "So are you going to tell me where i can find the zip ioslave so i can try to fix this bug or what?" and instead of answering "I don't know, I'm not a technical guy, you'll have to find for yourself", you simply ignored my question and didn't answer it at all, probably because you're angry I'm using the proper name of the technology for some reason.
Comment 12 Justin Zobel 2020-12-02 01:29:35 UTC
I've just tested this with the attached archived PDF in the preview and I am not experiencing the crash with Okular 1.11.3.

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved.

I have set the bug status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thank you.
Comment 13 sedrubal 2020-12-02 09:21:24 UTC
Yes this should be fixed now. There is also an alert, that you can't save the document and you have to save it under another location.