Bug 411999

Summary: kmail crashes on a base64 encoded PDF file
Product: [Applications] kmail2 Reporter: Erwin Lam <kdebugtracker.221102>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED DOWNSTREAM    
Severity: crash CC: vkrause, winter
Priority: NOR    
Version: 5.12.1   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: GDB backtrace
Message with the base64 encoded PDF causing the issue.

Description Erwin Lam 2019-09-17 18:19:13 UTC
Created attachment 122695 [details]
GDB backtrace

SUMMARY

I received a base64 encoded PDF file (a newsletter) from a family member. When the message with the attachment appeared into my inbox, kmail crashed immediately. After removing the message from the inbox, kmail could be started again and worked flawlessly.

STEPS TO REPRODUCE
1. Put mail with base64 encoded PDF in inbox
2. Start kmail.
3. kmail crashes immediately. No time to even open the offending e-mail.
4. Remove the offending message from the inbox.
5. Restart kmail.
6. kmail works again flawlessly.


OBSERVED RESULT
kmail crashes as soon as the e-mail appears in the inbox.

EXPECTED RESULT
kmail does not crash and I would be able to read the message.

SOFTWARE/OS VERSIONS
Linux: openSUSE Leap 15.1
KDE Plasma Version: 5.16.5
KDE Frameworks Version: 5.62.0
Qt Version: 5.13.1

ADDITIONAL INFORMATION
Attache backtrace & the offending e-mail message.
Comment 1 Erwin Lam 2019-09-17 18:21:06 UTC
Created attachment 122696 [details]
Message with the base64 encoded PDF causing the issue.
Comment 2 Erwin Lam 2019-09-17 18:22:40 UTC
If I manually retrieve the base64 encoded content from the e-mail and decode it I get a valid PDF file, i.e. okular has no problem with it.
Comment 3 Allen Winter 2019-10-14 21:27:30 UTC
of course it works fine for me.

I do see you are using a newer poppler than I am.  I'm still using poppler 0.67.
also could be a bug in kitinerary.

I'll CC Volker on this. maybe he has an idea.
Comment 4 Volker Krause 2019-10-15 12:58:03 UTC
A local workaround for this is to delete /usr/lib64/plugins/messageviewer/bodypartformatter/messageviewer_bodypartformatter_semantic.so (exact location can vary slightly depending on the distro).

This entire class of errors has been mitigated in 19.12 by moving PDF parsing out of the KMail process.
Comment 5 Allen Winter 2019-10-15 17:15:46 UTC
I suppose this should be downstreamed to your distro.

I don't think there's anything KDE can do for you.