Bug 433909 - Okular crashes while opening some PDF files
Summary: Okular crashes while opening some PDF files
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 20.12.2
Platform: openSUSE Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords: drkonqi
Depends on:
Blocks:
 
Reported: 2021-03-03 12:30 UTC by Michal Šmahel
Modified: 2021-03-09 22:57 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-21904-0.html (2.17 KB, text/html)
2021-03-04 15:04 UTC, Michal Šmahel
Details
vypis_102748423_2250_2021-02-01_2021-02-28.pdf (86.20 KB, application/pdf)
2021-03-08 20:06 UTC, Michal Šmahel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Šmahel 2021-03-03 12:30:10 UTC
Application: okular (20.12.2)

Qt Version: 5.15.2
Frameworks Version: 5.79.0
Operating System: Linux 5.11.0-4.g9ce8b38-default x86_64
Windowing System: X11
Drkonqi Version: 5.21.0
Distribution: "openSUSE Tumbleweed"

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

I was opening the file by clicking on its icon in Doplphin, when Okular started loading and in a few seconds crashed.

The crash can be reproduced every time.

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

[KCrash Handler]
#4  FormWidget::getWidgetAnnotation (this=0x0) at /usr/src/debug/poppler-qt5-21.02.0-1.1.x86_64/poppler/Form.h:148
#5  Poppler::Document::signatures (this=0x55fa8bd6e980) at /usr/src/debug/poppler-qt5-21.02.0-1.1.x86_64/qt5/src/poppler-document.cc:829
#6  0x00007fc6d80be495 in PDFGenerator::loadPages (rotation=0, clear=false, pagesVector=..., this=0x55fa8b521400) at /usr/src/debug/okular-20.12.2-1.2.x86_64/generators/poppler/generator_pdf.cpp:763
#7  PDFGenerator::init (this=0x55fa8b521400, pagesVector=..., password=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/generators/poppler/generator_pdf.cpp:627
#8  0x00007fc6e033bd1e in Okular::DocumentPrivate::openDocumentInternal (this=0x55fa8b25d8e0, offer=..., isstdin=<optimized out>, docFile=..., filedata=..., password=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/core/document.cpp:893
#9  0x00007fc6e034876b in Okular::Document::openDocument (this=this@entry=0x55fa8b459ec0, docFile=..., url=..., _mime=..., password=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/core/document.cpp:2339
#10 0x00007fc6e0485ff5 in Okular::Part::doOpenFile (this=this@entry=0x55fa8b41ae40, mimeA=..., fileNameToOpenA=..., isCompressedFile=isCompressedFile@entry=0x7fff6e302e67) at /usr/src/debug/okular-20.12.2-1.2.x86_64/part/part.cpp:1372
#11 0x00007fc6e048724b in Okular::Part::openFile (this=0x55fa8b41ae40) at /usr/src/debug/okular-20.12.2-1.2.x86_64/part/part.cpp:1490
#12 0x00007fc6e7c06405 in KParts::ReadOnlyPartPrivate::openLocalFile (this=this@entry=0x55fa8b3d2d20) at /usr/src/debug/kparts-5.79.0-1.1.x86_64/src/readonlypart.cpp:178
#13 0x00007fc6e7c0a73f in KParts::ReadOnlyPart::openUrl (this=0x55fa8b41ae40, url=...) at /usr/src/debug/kparts-5.79.0-1.1.x86_64/src/readonlypart.cpp:141
#14 0x00007fc6e0483fd3 in Okular::Part::openUrl (this=<optimized out>, _url=..., swapInsteadOfOpening=<optimized out>) at /usr/src/debug/okular-20.12.2-1.2.x86_64/part/part.cpp:1722
#15 0x000055fa89b245fd in Shell::openUrl (this=<optimized out>, url=..., serializedOptions=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/shell/shell.cpp:282
#16 0x000055fa89b255ae in Shell::openDocument (this=0x55fa8b410b30, url=..., serializedOptions=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/shell/shell.cpp:233
#17 0x000055fa89b1e8f6 in Shell::openDocument (serializedOptions=..., url=..., this=0x55fa8b410b30) at /usr/src/debug/okular-20.12.2-1.2.x86_64/shell/okular_main.cpp:165
#18 Okular::main (serializedOptions=..., paths=...) at /usr/src/debug/okular-20.12.2-1.2.x86_64/shell/okular_main.cpp:166
#19 main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/okular-20.12.2-1.2.x86_64/shell/main.cpp:95
[Inferior 1 (process 9238) detached]

The reporter indicates this bug may be a duplicate of or related to bug 185258.

Possible duplicates by query: bug 421603, bug 418738, bug 416077, bug 414179, bug 409684.

Reported using DrKonqi
Comment 1 Yuri Chornoivan 2021-03-03 12:35:15 UTC
Does it happen for every file?

If not, does it happen for other poppler-based PDF viewers (Evince, qpdfview)?

Can you share the file that crashes Okular for testing?

Thanks in advance for your answers.
Comment 2 Michal Šmahel 2021-03-04 15:04:54 UTC
Created attachment 136370 [details]
attachment-21904-0.html

Hello,
	Does it happen for every file?No, only for a few files. Most files are open correctly.
	If not, does it happen for other poppler-based PDF viewers (Evince, qpdfview)?The last file that caused the reported crash has a problem only in Okular. I tried opening it in Google Chrome and it was successful.
	Can you share the file that crashes Okular for testing?Unfortunatelly I can't. It was document with some bank information.

Thanks for reading my response. Have a nice day.
Greetings,
Michal ŠMAHEL
---------------------------------
E-mail: ceskyDJ@seznam.cz (mailto:ceskyDJ@seznam.cz)

March 3, 2021 1:35 PM, "Yuri Chornoivan" <bugzilla_noreply@kde.org (mailto:bugzilla_noreply@kde.org)> wrote:
 https://bugs.kde.org/show_bug.cgi?id=433909 (https://bugs.kde.org/show_bug.cgi?id=433909)

Yuri Chornoivan <yurchor@ukr.net (mailto:yurchor@ukr.net)> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WAITINGFORINFO
CC| |yurchor@ukr.net (mailto:%7Cyurchor@ukr.net)
Status|REPORTED |NEEDSINFO

--- Comment #1 from Yuri Chornoivan <yurchor@ukr.net (mailto:yurchor@ukr.net)> ---
Does it happen for every file?

If not, does it happen for other poppler-based PDF viewers (Evince, qpdfview)?

Can you share the file that crashes Okular for testing?

Thanks in advance for your answers.

--
You are receiving this mail because:
You reported the bug.
Comment 3 Yuri Chornoivan 2021-03-04 15:09:28 UTC
Change the status.
Comment 4 Yuri Chornoivan 2021-03-04 15:09:28 UTC
Change the status.
Comment 5 Albert Astals Cid 2021-03-04 21:49:29 UTC
Without a file to test on, this is basically unfixable, the reason of the crash is clear by looking at the crash information, but what is not clear is what we should do, if it's the document that is malformed or we're misunderstanding something in the signature handling, so really we need a file that reproduces this crash to be able to understand what is wrong and fix it properly.
Comment 6 2wxsy58236r3 2021-03-05 09:33:58 UTC
Do you have another test file which does not contain private information?

Or perhaps Okular developers can provide a secure way (e.g. email with PGP encryption, Keybase...) for bug reporter to submit the file privately?
Comment 7 Michal Šmahel 2021-03-05 13:15:27 UTC
Hello,

I only have a problem with sharing it to wide public (on forum). If there is some option to send the file directly to developers, I'll send it. Something like this happened some time ago but I haven't the problematic file from that time. Only file I actually have is the last private one.

Thanks for reading a possible reply. Have a nice day.



Greetings,
Michal ŠMAHEL
---------------------------------
E-mail: ceskyDJ@seznam.cz
Comment 8 Albert Astals Cid 2021-03-07 23:24:52 UTC
You can send it to me at aacid@kde.org but understand that given the fact that the file is not public it may be harder to convince other people a change i propose to the code is the correct fix.
Comment 9 Michal Šmahel 2021-03-08 20:06:56 UTC
Created attachment 136497 [details]
vypis_102748423_2250_2021-02-01_2021-02-28.pdf

Hi,

I have a good message for you! I found document from bank, which doesn't contain too much information and can be published to the forum. It's account statement for my secondary bank account which is just for occasional transactions. It cause the same issue and it is from the same author (my bank) like the first problematic document.

I hope it'll help you. If you need more assistance, just contact me, please.



Greetings,
Michal ŠMAHEL
---------------------------------
E-mail: ceskyDJ@seznam.cz
Comment 10 Albert Astals Cid 2021-03-08 23:35:20 UTC
I'll try to make it work, but the PDF file is badly formed, it says

<</Type /Annot /SubType /Widget

When it should say

<</Type /Annot /Subtype /Widget

yes casing is important.

I'll think whether to special case this and try it twice or what
Comment 11 Albert Astals Cid 2021-03-09 16:55:32 UTC
It's not an Okular bug but a poppler bug (well it's actually a bug of the file being malformed, but poppler should not crash on malformed files)

Will be fixed in next poppler release https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/825
Comment 12 Michal Šmahel 2021-03-09 22:57:53 UTC
Hello,

thanks for your help and your time spent by solving this issue.

Have a nice day.



Greetings,
Michal ŠMAHEL
---------------------------------
E-mail: ceskyDJ@seznam.cz
Telefon: +420 774 912 670