Bug 379749

Summary: Crash when saving/closing a PDF with forms
Product: [Applications] okular Reporter: Gery <bugzilla>
Component: PDF backendAssignee: Okular developers <okular-devel>
Status: RESOLVED DUPLICATE    
Severity: crash CC: aacid, andrew, nate, oliver.sander
Priority: NOR    
Version: 1.1.0   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Backtrace
valgrind output
valgrind output
Backtrace with debug symbols
PDF file that causes the crash

Description Gery 2017-05-12 12:24:33 UTC
Created attachment 105475 [details]
Backtrace

As the title says Okular crashes when saving a PDF with forms. It only happens after changing the text of a multiline form field.

Steps to reproduce:
1. Open PDF which contains multiline form fields
2. Change the text in one of them
3. Close/save the file

Okular still successfully saves the changes, but crashes afterwards.

Also, when the textfield is not in focus and you enter text the scrolling is quite jerky (input elements stay at their old place until the scrolling is done and you stop entering text for about 1-2 seconds). And the radio buttons have some text behind them when the forms are shown.

I cannot upload the file here, but if you need it I can send it to you by mail.
Comment 1 Oliver Sander 2017-05-12 12:28:51 UTC
The backtrace is not very helpful.  Can you install debug symbols and then post a new backtrace?  Or you can send me the file.  If I can reproduce the problem on the current git master I can also post the proper backtrace.
Comment 2 Gery 2017-05-12 12:57:13 UTC
Created attachment 105476 [details]
valgrind output

I've installed the debug symbols for Okular and Poppler but now I don't get a backtrace anymore. However, I can have attached a the output of valgrind, which shows where poppler accesses invalid memory.
I also sent you the file.
Comment 3 Gery 2017-05-12 12:59:49 UTC
Created attachment 105477 [details]
valgrind output

Fix upload
Comment 4 Oliver Sander 2017-05-12 13:48:31 UTC
Created attachment 105480 [details]
Backtrace with debug symbols
Comment 5 Oliver Sander 2017-05-12 13:49:12 UTC
Reproduced on Debian testing with poppler 0.48 and okular git master.
Comment 6 Gery 2017-05-16 20:01:32 UTC
Created attachment 105598 [details]
PDF file that causes the crash

Here's a sample file which I can add thanks to Oliver Sander.
Comment 7 Andrew Chen 2017-09-16 09:25:42 UTC
Looks like a qt bug to me. The destructor of QSyntaxHighlighter should not emit a QTextEdit::textChanged signal.
Comment 8 Nate Graham 2017-09-19 04:10:21 UTC
Can you find or file a Qt bug for that?
Comment 9 Albert Astals Cid 2017-09-19 07:23:50 UTC
Honestly, i'm pretty sure we can fix ourselves without being lazy and saying "this is something Qt should fix"
Comment 10 Albert Astals Cid 2018-06-04 23:10:28 UTC

*** This bug has been marked as a duplicate of bug 393334 ***