Bug 472356 - Okular crashes when configuring certificates with SafeNet Client
Summary: Okular crashes when configuring certificates with SafeNet Client
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 23.04.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-18 12:54 UTC by Ovidiu D. Niţan
Modified: 2024-05-14 14:11 UTC (History)
2 users (show)

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


Attachments
gdb trace (39.38 KB, text/plain)
2023-07-18 12:54 UTC, Ovidiu D. Niţan
Details
Valgrind output (21.03 KB, text/plain)
2023-07-18 14:45 UTC, Ovidiu D. Niţan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ovidiu D. Niţan 2023-07-18 12:54:06 UTC
Created attachment 160358 [details]
gdb trace

I have a hardware token from SafeNet which I'm using to sign PDF documents. I'd like to use this with Okular, too, and I got some progress to the point I can sign PDF documents with LibreOffice or pdfsig. When I try do to this with Okular, it crashes on configuring the PDF backend.


STEPS TO REPRODUCE
1. With your SafeNet token attached, go to Settings -> Configure Backends...
2. Select PDF from sidebar
3. A popup asking you to insert the password for the token will appear.

OBSERVED RESULT
Inserting a correct password or even pressing Cancel will crash the app with the following error:

Thread 1 "okular" received signal SIGSEGV, Segmentation fault.
0x00007ffff71a434f in QWidgetPrivate::drawWidget(QPaintDevice*, QRegion const&, QPoint const&, QFlags<QWidgetPrivate::DrawWidgetFlag>, QPainter*, QWidgetRepaintManager*) () from /usr/lib/libQt5Widgets.so.5

EXPECTED RESULT
The app should not crash

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.27.6
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10

ADDITIONAL INFORMATION
Comment 1 Albert Astals Cid 2023-07-18 14:33:35 UTC
Could you try to get a valgrind trace?

Run

valgrind okular file.pdf

and attach the output here
Comment 2 Ovidiu D. Niţan 2023-07-18 14:45:35 UTC
Created attachment 160363 [details]
Valgrind output
Comment 3 Ovidiu D. Niţan 2023-07-18 14:48:10 UTC
There is also a vgcore.16191 file which I think was generated by valgrind, if it is useful to debug the issue I can upload it somewhere.
Comment 4 Albert Astals Cid 2023-07-18 20:05:25 UTC
The crash information is very strange, seems like it would crash in painting the listview code.

Do you use Plasma? X11 or Wayland?

Have you configured and special style or some special graphical thing that you can think of?
Comment 5 Ovidiu D. Niţan 2023-07-19 18:07:39 UTC
I'm on X11. I'm not using anything fancy, except that my display runs at 120Hz and my GPU is an AMD Radeon Mobile series.
Comment 6 Albert Astals Cid 2023-07-23 16:15:39 UTC
unfortunately i'm out of ideas here.
Comment 7 András Manţia 2024-04-18 21:37:31 UTC
I can confirm this on X11, Okular  24.0.2, Qt 6.7.0.
Comment 8 Bug Janitor Service 2024-04-18 22:07:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/okular/-/merge_requests/973
Comment 9 Albert Astals Cid 2024-04-20 13:57:14 UTC
Git commit 4435325e5a6f767ecd054302352ad0cd48158c13 by Albert Astals Cid, on behalf of Andras Mantia.
Committed on 20/04/2024 at 13:44.
Pushed by aacid into branch 'master'.

Load certificates delayed

Showing a dialog from a Paint event handler is something Qt doesn't like.

M  +21   -15   generators/poppler/pdfsettingswidget.cpp

https://invent.kde.org/graphics/okular/-/commit/4435325e5a6f767ecd054302352ad0cd48158c13
Comment 10 Ovidiu D. Niţan 2024-05-14 14:11:00 UTC
Sorry if this is spam, but I wanted to let you know that I built the latest code from master and seems that the issue is fixed. Thanks to everyone involved in making Okular a better software.