Bug 477153 - Okular crashed when saving a document with form-fillable elements
Summary: Okular crashed when saving a document with form-fillable elements
Status: REPORTED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 23.08.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-11-17 17:33 UTC by Mirko
Modified: 2023-12-09 00:38 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Console output of 'valgrind okular' (42.89 KB, text/plain)
2023-12-08 22:15 UTC, Mirko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mirko 2023-11-17 17:33:12 UTC
Application: okular (23.08.3)

Qt Version: 5.15.11
Frameworks Version: 5.112.0
Operating System: Linux 6.5.9-arch2-1 x86_64
Windowing System: Wayland
Distribution: Arch Linux
DrKonqi: 5.27.9 [KCrashBackend]

-- Information about the crash:
Okular crashed the moment I hit CTRL+S to save the document after filling some form fields. Saving previously worked in the same document after filling forms. Opening the document again, filling some forms, and saving also wroks without issues and does not lead to a crash.

The crash does not seem to be reproducible.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault
Content of s_kcrashErrorMessage: std::unique_ptr<char []> = {get() = <optimized out>}
[KCrash Handler]
#6  0x00007fe5a00f3cd0 in Poppler::FormField::isVisible() const (this=0x563853cdeb50) at /usr/src/debug/poppler/poppler-23.10.0/qt5/src/poppler-form.cc:199
#7  0x00007fe5a3757cf5 in PageViewItem::setFormWidgetsVisible(bool) (this=this@entry=0x563853966bd0, visible=true) at /usr/src/debug/okular/okular-23.08.3/part/pageviewutils.cpp:178
#8  0x00007fe5a375ca45 in PageViewItem::setFormWidgetsVisible(bool) (visible=<optimized out>, this=0x563853966bd0) at /usr/src/debug/okular/okular-23.08.3/part/pageviewutils.cpp:171
#9  PageViewItem::setVisible(bool) (visible=true, this=0x563853966bd0) at /usr/src/debug/okular/okular-23.08.3/part/pageviewutils.cpp:157
#10 PageView::slotRelayoutPages() (this=<optimized out>) at /usr/src/debug/okular/okular-23.08.3/part/pageview.cpp:4582
#11 0x00007fe5a375cf81 in PageView::delayedResizeEvent() (this=0x563852cd2d80) at /usr/src/debug/okular/okular-23.08.3/part/pageview.cpp:4650
#12 0x00007fe5cb6d1097 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd13e17c60, r=<optimized out>, this=0x563852ca3850, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#13 doActivate<false>(QObject*, int, void**) (sender=0x563852caa4e0, signal_index=3, argv=0x7ffd13e17c60) at kernel/qobject.cpp:3925
#14 0x00007fe5cb6d2bcf in QTimer::timeout(QTimer::QPrivateSignal) (this=<optimized out>, _t1=...) at .moc/moc_qtimer.cpp:205
#15 0x00007fe5cb6c3b4e in QObject::event(QEvent*) (this=0x563852caa4e0, e=0x7ffd13e17dd0) at kernel/qobject.cpp:1324
#16 0x00007fe5cc3788ff in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x563852caa4e0, e=0x7ffd13e17dd0) at kernel/qapplication.cpp:3640
#17 0x00007fe5cb69c168 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x563852caa4e0, event=0x7ffd13e17dd0) at kernel/qcoreapplication.cpp:1064
#18 0x00007fe5cb6ea7cb in QTimerInfoList::activateTimers() (this=0x563852a3e190) at kernel/qtimerinfo_unix.cpp:643
#19 0x00007fe5cb6eadba in timerSourceDispatch(GSource*, GSourceFunc, gpointer) (source=<optimized out>) at kernel/qeventdispatcher_glib.cpp:183
#20 0x00007fe5c9d0df69 in g_main_dispatch (context=0x7fe5c0000ec0) at ../glib/glib/gmain.c:3476
#21 0x00007fe5c9d6c327 in g_main_context_dispatch_unlocked (context=0x7fe5c0000ec0) at ../glib/glib/gmain.c:4284
#22 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fe5c0000ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#23 0x00007fe5c9d0c162 in g_main_context_iteration (context=0x7fe5c0000ec0, may_block=1) at ../glib/glib/gmain.c:4414
#24 0x00007fe5cb6eaf7c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x563852a3e630, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#25 0x00007fe5cb69ae74 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd13e18080, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#26 0x00007fe5cc57456b in QDialog::exec() (this=0x5638534ba7a0) at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#27 0x00007fe5ccbcdc89 in KMessageBox::createKMessageBox(QDialog*, QDialogButtonBox*, QIcon const&, QString const&, QStringList const&, QString const&, bool*, QFlags<KMessageBox::Option>, QString const&, QMessageBox::Icon) (dialog=dialog@entry=0x5638534ba7a0, buttons=buttons@entry=0x563854efea60, icon=..., text=..., strlist=..., ask=..., checkboxReturn=0x0, options=..., details=..., notifyType=QMessageBox::Critical) at /usr/src/debug/kwidgetsaddons5/kwidgetsaddons-5.112.0/src/kmessagebox.cpp:375
#28 0x00007fe5ccbce3bc in KMessageBox::createKMessageBox(QDialog*, QDialogButtonBox*, QMessageBox::Icon, QString const&, QStringList const&, QString const&, bool*, QFlags<KMessageBox::Option>, QString const&) (dialog=0x5638534ba7a0, buttons=0x563854efea60, icon=QMessageBox::Critical, text=..., strlist=..., ask=..., checkboxReturn=0x0, options=..., details=...) at /usr/src/debug/kwidgetsaddons5/kwidgetsaddons-5.112.0/src/kmessagebox.cpp:153
#29 0x00007fe5ccc1b756 in KMessageBox::errorInternal(QDialog*, QString const&, QString const&, KGuiItem const&, QFlags<KMessageBox::Option>) [clone .isra.0] (dialog=dialog@entry=0x5638534ba7a0, text=..., buttonOk=..., options=options@entry=..., title=<optimized out>) at /usr/src/debug/kwidgetsaddons5/kwidgetsaddons-5.112.0/src/kmessagebox.cpp:929
#30 0x00007fe5ccbcb94a in KMessageBox::error(QWidget*, QString const&, QString const&, QFlags<KMessageBox::Option>) (parent=0x563852bfab60, text=..., title=..., options=options@entry=...) at /usr/src/debug/kwidgetsaddons5/kwidgetsaddons-5.112.0/src/kmessagebox.cpp:934
#31 0x00007fe5a36e1579 in Okular::Part::openUrl(QUrl const&, bool) (this=<optimized out>, _url=<optimized out>, swapInsteadOfOpening=<optimized out>) at /usr/src/debug/okular/okular-23.08.3/part/part.cpp:1838
#32 0x00007fe5a36ed741 in Okular::Part::saveAs(QUrl const&, QFlags<Okular::Part::SaveAsFlag>) (this=this@entry=0x563852bf6a10, saveUrl=..., flags=...) at /usr/src/debug/okular/okular-23.08.3/part/part.cpp:2930
#33 0x00007fe5a36edcd5 in Okular::Part::saveAs(QUrl const&) (saveUrl=..., this=0x563852bf6a10) at /usr/src/debug/okular/okular-23.08.3/part/part.cpp:2639
#34 Okular::Part::saveFile() (this=0x563852bf6a10) at /usr/src/debug/okular/okular-23.08.3/part/part.cpp:2577
#35 Okular::Part::saveFile() (this=0x563852bf6a10) at /usr/src/debug/okular/okular-23.08.3/part/part.cpp:2572
#36 0x00007fe5cb6d1097 in QtPrivate::QSlotObjectBase::call(QObject*, void**) (a=0x7ffd13e18820, r=<optimized out>, this=0x563852ed0770, this=<optimized out>, r=<optimized out>, a=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#37 doActivate<false>(QObject*, int, void**) (sender=0x563852b7d6a0, signal_index=4, argv=0x7ffd13e18820) at kernel/qobject.cpp:3925
#38 0x00007fe5cc36bbb7 in QAction::triggered(bool) (this=this@entry=0x563852b7d6a0, _t1=<optimized out>) at .moc/moc_qaction.cpp:376
#39 0x00007fe5cc37160b in QAction::activate(QAction::ActionEvent) (this=0x563852b7d6a0, event=<optimized out>) at kernel/qaction.cpp:1161
#40 0x00007fe5cc3716de in QAction::event(QEvent*) (e=<optimized out>, this=<optimized out>) at kernel/qaction.cpp:1086
#41 QAction::event(QEvent*) (this=<optimized out>, e=<optimized out>) at kernel/qaction.cpp:1075
#42 0x00007fe5cc3788ff in QApplicationPrivate::notify_helper(QObject*, QEvent*) (this=<optimized out>, receiver=0x563852b7d6a0, e=0x7ffd13e189b0) at kernel/qapplication.cpp:3640
#43 0x00007fe5cb69c168 in QCoreApplication::notifyInternal2(QObject*, QEvent*) (receiver=0x563852b7d6a0, event=0x7ffd13e189b0) at kernel/qcoreapplication.cpp:1064
#44 0x00007fe5cb69c1d3 in QCoreApplication::sendEvent(QObject*, QEvent*) (receiver=<optimized out>, event=<optimized out>) at kernel/qcoreapplication.cpp:1462
#45 0x00007fe5cbb77036 in QShortcutMap::dispatchEvent(QKeyEvent*) (this=this@entry=0x563852a17718, e=e@entry=0x7ffd13e18a70) at kernel/qshortcutmap.cpp:675
#46 0x00007fe5cbb77425 in QShortcutMap::tryShortcut(QKeyEvent*) (this=0x563852a17718, e=0x7ffd13e18a70) at kernel/qshortcutmap.cpp:343
#47 0x00007fe5cbb2be28 in QWindowSystemInterface::handleShortcutEvent(QWindow*, unsigned long, int, QFlags<Qt::KeyboardModifier>, unsigned int, unsigned int, unsigned int, QString const&, bool, unsigned short) (window=<optimized out>, timestamp=159041226, keyCode=83, modifiers=..., nativeScanCode=39, nativeVirtualKey=115, nativeModifiers=20, text=..., autorepeat=false, count=1) at kernel/qwindowsysteminterface.cpp:477
#48 0x00007fe5cbb45542 in QGuiApplicationPrivate::processKeyEvent(QWindowSystemInterfacePrivate::KeyEvent*) (e=0x563854f3b910) at kernel/qguiapplication.cpp:2398
#49 0x00007fe5cbb2a6f5 in QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>) (flags=...) at kernel/qwindowsysteminterface.cpp:1169
#50 0x00007fe5c9c12ce5 in userEventSourceDispatch(_GSource*, int (*)(void*), void*) () at /usr/lib/libQt5WaylandClient.so.5
#51 0x00007fe5c9d0df69 in g_main_dispatch (context=0x7fe5c0000ec0) at ../glib/glib/gmain.c:3476
#52 0x00007fe5c9d6c327 in g_main_context_dispatch_unlocked (context=0x7fe5c0000ec0) at ../glib/glib/gmain.c:4284
#53 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fe5c0000ec0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4349
#54 0x00007fe5c9d0c162 in g_main_context_iteration (context=0x7fe5c0000ec0, may_block=1) at ../glib/glib/gmain.c:4414
#55 0x00007fe5cb6eaf7c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) (this=0x563852a3e630, flags=...) at kernel/qeventdispatcher_glib.cpp:423
#56 0x00007fe5cb69ae74 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (this=this@entry=0x7ffd13e18e20, flags=..., flags@entry=...) at ../../include/QtCore/../../src/corelib/global/qflags.h:69
#57 0x00007fe5cb69c313 in QCoreApplication::exec() () at ../../include/QtCore/../../src/corelib/global/qflags.h:121
#58 0x00007fe5cbb3bf12 in QGuiApplication::exec() () at kernel/qguiapplication.cpp:1870
#59 0x00007fe5cc376cda in QApplication::exec() () at kernel/qapplication.cpp:2832
#60 0x00005638519b34ca in main(int, char**) (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/okular/okular-23.08.3/shell/main.cpp:109
[Inferior 1 (process 222066) detached]

Reported using DrKonqi
Comment 1 fanzhuyifan 2023-11-18 17:02:20 UTC
Thank you for your bug report! Would you be able to share one such pdf on which you could trigger this crash?
Comment 2 Mirko 2023-11-20 16:17:42 UTC
(In reply to fanzhuyifan from comment #1)
> Thank you for your bug report! Would you be able to share one such pdf on
> which you could trigger this crash?

Unfortunately I cannot share the document that caused the crash. I understand that might make it hard to reproduce the issue. 

If there is anything else I can do on my side to help let me know.
Comment 3 Albert Astals Cid 2023-11-20 23:08:01 UTC
Run

valgrind okular

and do what you make it to crash and then attach the output from valgrind here (be prepared for things to be veeeeeeeeeery slow)
Comment 4 Mirko 2023-12-08 22:15:26 UTC
Created attachment 164025 [details]
Console output of 'valgrind okular'

Still can't find any consistent way to make the bug happen, just changing form fields and saving a bunch of times seems to have caused it again though. Hope this log helps.
Comment 5 Albert Astals Cid 2023-12-09 00:38:35 UTC
valgrind reports some issues yes.

Also the "refreshInternalPageReferences failed" thing isn't great.

But without the file to be able to reproduce the issue this goes down quite a bit in the priority queue quite a bit since there's things that are more immediately workable than this