Bug 475798 - Okular crashes right after applying digital signature
Summary: Okular crashes right after applying digital signature
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 23.04.3
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2023-10-18 15:47 UTC by Erik Quaeghebeur
Modified: 2023-11-24 23:08 UTC (History)
1 user (show)

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


Attachments
output of valgrind when running okular to sign a document using a smartcard (14.57 KB, text/plain)
2023-10-20 08:39 UTC, Erik Quaeghebeur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Quaeghebeur 2023-10-18 15:47:11 UTC
Application: okular (23.04.3)
 (Compiled from sources)
Qt Version: 5.15.10
Frameworks Version: 5.110.0
Operating System: Linux 6.1.53-gentoo-r1-a x86_64
Windowing System: X11
Distribution: "Gentoo Linux"
DrKonqi: 5.27.8 [KCrashBackend]

-- Information about the crash:
When signing a pdf form in okular (with a certificate on a smartcard), it often but  not always crashes right after the signature is applied. So I can reopen pdf and verify that the signature has been applied.

The crash can be reproduced sometimes.

-- Backtrace:
Application: Okular (okular), signal: Segmentation fault

[KCrash Handler]
#4  0x00007a6152f368e3 in Okular::Page::number (this=0x5ccebd63cc90) at /var/tmp/portage/kde-apps/okular-23.04.3/work/okular-23.04.3/core/page.cpp:162
#5  0x00007a615238649d in SignaturePartUtils::signUnsignedSignature (form=0x5ccebda8beb0, pageView=0x5ccebcc68350, doc=0x5ccebca9d8b0) at /var/tmp/portage/kde-apps/okular-23.04.3/work/okular-23.04.3/part/signaturepartutils.cpp:120
#6  0x00007a617a4c5ea4 in QtPrivate::QSlotObjectBase::call (a=0x7ffeea71a4d0, r=0x5ccebd87ac30, this=0x5ccebd87aa80) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/include/QtCore/../../src/corelib/kernel/qobjectdefs_impl.h:398
#7  doActivate<false> (sender=0x5ccebd87ac30, signal_index=9, argv=0x7ffeea71a4d0) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qobject.cpp:3925
#8  0x00007a617a4bfbd7 in QMetaObject::activate (sender=sender@entry=0x5ccebd87ac30, m=m@entry=0x7a617b496240 <QAbstractButton::staticMetaObject>, local_signal_index=local_signal_index@entry=2, argv=argv@entry=0x7ffeea71a4d0) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qobject.cpp:3985
#9  0x00007a617b05b0a2 in QAbstractButton::clicked (this=this@entry=0x5ccebd87ac30, _t1=<optimized out>) at .moc/moc_qabstractbutton.cpp:308
#10 0x00007a617b05b2fa in QAbstractButtonPrivate::emitClicked (this=0x5ccebd084c10) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/widgets/qabstractbutton.cpp:416
#11 0x00007a617b05ceb7 in QAbstractButtonPrivate::click (this=0x5ccebd084c10) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/widgets/qabstractbutton.cpp:409
#12 0x00007a617b05d0e3 in QAbstractButton::mouseReleaseEvent (this=0x5ccebd87ac30, e=0x7ffeea71aa80) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/widgets/qabstractbutton.cpp:1045
#13 0x00007a617afa6fa8 in QWidget::event (this=0x5ccebd87ac30, event=0x7ffeea71aa80) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qwidget.cpp:9045
#14 0x00007a617af631de in QApplicationPrivate::notify_helper (this=this@entry=0x5ccebc7606e0, receiver=receiver@entry=0x5ccebd87ac30, e=e@entry=0x7ffeea71aa80) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qapplication.cpp:3640
#15 0x00007a617af6b8e2 in QApplication::notify (this=<optimized out>, receiver=0x5ccebd87ac30, e=0x7ffeea71aa80) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qapplication.cpp:3084
#16 0x00007a617a492d48 in QCoreApplication::notifyInternal2 (receiver=0x5ccebd87ac30, event=0x7ffeea71aa80) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qcoreapplication.cpp:1064
#17 0x00007a617a492f4e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qcoreapplication.cpp:1474
#18 0x00007a617af69be4 in QApplicationPrivate::sendMouseEvent (receiver=receiver@entry=0x5ccebd87ac30, event=event@entry=0x7ffeea71aa80, alienWidget=<optimized out>, nativeWidget=0x5ccebc89a1c0, buttonDown=buttonDown@entry=0x7a617b4bf9d0 <qt_button_down>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qapplication.cpp:2622
#19 0x00007a617afc0573 in QWidgetWindow::handleMouseEvent (this=this@entry=0x5ccebd39ee60, event=event@entry=0x7ffeea71ad50) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qwidgetwindow.cpp:684
#20 0x00007a617afc398f in QWidgetWindow::event (this=0x5ccebd39ee60, event=0x7ffeea71ad50) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qwidgetwindow.cpp:300
#21 0x00007a617af631de in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x5ccebd39ee60, e=0x7ffeea71ad50) at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qapplication.cpp:3640
#22 0x00007a617a492d48 in QCoreApplication::notifyInternal2 (receiver=0x5ccebd39ee60, event=0x7ffeea71ad50) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qcoreapplication.cpp:1064
#23 0x00007a617a492f4e in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qcoreapplication.cpp:1474
#24 0x00007a617a92739b in QGuiApplicationPrivate::processMouseEvent (e=0x5ccebd811820) at /var/tmp/portage/dev-qt/qtgui-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/gui/kernel/qguiapplication.cpp:2285
#25 0x00007a617a905bcb in QWindowSystemInterface::sendWindowSystemEvents (flags=flags@entry=...) at /var/tmp/portage/dev-qt/qtgui-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/gui/kernel/qwindowsysteminterface.cpp:1169
#26 0x00007a6175b16fca in xcbSourceDispatch (source=<optimized out>) at /var/tmp/portage/dev-qt/qtgui-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/plugins/platforms/xcb/qxcbeventdispatcher.cpp:105
#27 0x00007a6178d1463c in g_main_context_dispatch () from /usr/lib64/libglib-2.0.so.0
#28 0x00007a6178d148e8 in ?? () from /usr/lib64/libglib-2.0.so.0
#29 0x00007a6178d1497c in g_main_context_iteration () from /usr/lib64/libglib-2.0.so.0
#30 0x00007a617a4e4976 in QEventDispatcherGlib::processEvents (this=0x5ccebc83e7c0, flags=...) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/corelib/kernel/qeventdispatcher_glib.cpp:423
#31 0x00007a617a49176b in QEventLoop::exec (this=this@entry=0x7ffeea71b0a0, flags=..., flags@entry=...) at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/include/QtCore/../../src/corelib/global/qflags.h:69
#32 0x00007a617a499a6d in QCoreApplication::exec () at /var/tmp/portage/dev-qt/qtcore-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/include/QtCore/../../src/corelib/global/qflags.h:121
#33 0x00007a617a91bb6c in QGuiApplication::exec () at /var/tmp/portage/dev-qt/qtgui-5.15.10-r2/work/qtbase-everywhere-src-5.15.10/src/gui/kernel/qguiapplication.cpp:1870
#34 0x00007a617af63155 in QApplication::exec () at /var/tmp/portage/dev-qt/qtwidgets-5.15.10-r3/work/qtbase-everywhere-src-5.15.10/src/widgets/kernel/qapplication.cpp:2832
#35 0x00005ccebace63e4 in main (argc=<optimized out>, argv=<optimized out>) at /var/tmp/portage/kde-apps/okular-23.04.3/work/okular-23.04.3/shell/main.cpp:109
[Inferior 1 (process 1229596) detached]

Reported using DrKonqi
Comment 1 Albert Astals Cid 2023-10-18 20:10:14 UTC
Can you install valgrind and run

valgrind okular

It will be slow. And then do the same thing you do to make it crash?

Once done, even if it doesn't crash, please attach the output of valgrind here.
Comment 2 Erik Quaeghebeur 2023-10-20 08:39:12 UTC
Created attachment 162445 [details]
output of valgrind when running okular to sign a document using a smartcard

(In reply to Albert Astals Cid from comment #1)
> Can you install valgrind and run
> 
> valgrind okular
> 
> It will be slow. And then do the same thing you do to make it crash?
> 
> Once done, even if it doesn't crash, please attach the output of valgrind here.

Attached. It did not crash this time. (I closed the okular windows, so also the one opened after creating the signed document, to stop the processing by valgrind.)
Comment 3 Albert Astals Cid 2023-10-20 20:26:43 UTC
Any chance you can upgrade to KF5 5.111 and see if that fixes the issue?
Comment 4 Erik Quaeghebeur 2023-10-23 20:04:54 UTC
(In reply to Albert Astals Cid from comment #3)
> Any chance you can upgrade to KF5 5.111 and see if that fixes the issue?

I'll do that once my distribution stabilizes it. I'll report back once that happens.
Comment 5 Bug Janitor Service 2023-11-07 03:45:45 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Erik Quaeghebeur 2023-11-08 09:58:50 UTC
(In reply to Bug Janitor Service from comment #5)
> This bug has been in NEEDSINFO status with no change for at least
> 15 days. Please provide the requested information as soon as
> possible and set the bug status as REPORTED. Due to regular bug
> tracker maintenance, if the bug is still in NEEDSINFO status with
> no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
> due to lack of needed information.
Please keep this open. I'm aware, but just awaiting stabilization for my distribution.
Comment 7 Erik Quaeghebeur 2023-11-24 22:34:08 UTC
(In reply to Albert Astals Cid from comment #3)
> Any chance you can upgrade to KF5 5.111 and see if that fixes the issue?
Comment 8 Erik Quaeghebeur 2023-11-24 22:35:40 UTC
(In reply to Albert Astals Cid from comment #3)
> Any chance you can upgrade to KF5 5.111 and see if that fixes the issue?
Tried with 5.112 and I could not reproduce the issue. (Running with Valgrind still gives many “blocks are possibly lost in loss record” messages.)
Comment 9 Albert Astals Cid 2023-11-24 23:08:30 UTC
(In reply to Erik Quaeghebeur from comment #8)
> (Running with Valgrind
> still gives many “blocks are possibly lost in loss record” messages.)

taht's not a crash