Bug 423148 - Okular crashes when opening a random PDF from Dolphin, but apparently only with certain screen arrangements.
Summary: Okular crashes when opening a random PDF from Dolphin, but apparently only wi...
Status: REOPENED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-18 10:50 UTC by catandras48+kde
Modified: 2020-12-02 01:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
okular crash report (7.34 KB, text/plain)
2020-06-18 10:50 UTC, catandras48+kde
Details
valgrind log (41.85 KB, text/plain)
2020-06-29 10:56 UTC, catandras48+kde
Details
display configuration (296.42 KB, image/jpeg)
2020-06-30 16:44 UTC, catandras48+kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description catandras48+kde 2020-06-18 10:50:00 UTC
Created attachment 129469 [details]
okular crash report

SUMMARY


STEPS TO REPRODUCE
1. Open any PDF in Dolphin with Okular as default or selected viewer
2. Okular crashed every time

OBSERVED RESULT

Okular crashes

EXPECTED RESULT

Okular opens any PDF

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 20.04
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8

ADDITIONAL INFORMATION

Lenovo ThinkPad T490 20N3S02J00

Please don't hestitate to contact me if I can assist you delivering information!
Comment 1 Albert Astals Cid 2020-06-18 21:38:58 UTC
Can you install the qt debug packages and get us an updated backtrace?
Comment 2 Albert Astals Cid 2020-06-18 21:39:27 UTC
Not an ubuntu user myself but https://wiki.ubuntu.com/Debug%20Symbol%20Packages may help
Comment 3 catandras48+kde 2020-06-19 08:08:46 UTC
Hello! Thank you for your support. I followed the instructions on
https://wiki.ubuntu.com/Debug%20Symbol%20Packages
but it didn't change the backtrace.

So I followed the Link "How to create useful crash reports" in The KDE Crash Handler
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Ubuntu-based_distros_.28Ubuntu.2C_Kubuntu.2C_KDE_Neon.2C_Linux_Mint.29
and klicked on the Debugging Program Crashes page
https://wiki.kubuntu.org/DebuggingProgramCrash

I installed apport-retrace and followed the man-page
http://manpages.ubuntu.com/manpages/focal/en/man1/apport-retrace.1.html

$ apport-retrace --gdb --sandbox system --cache ~/.cache/apport-retrace /var/crash/_usr_bin_okular.1000.crash
ERROR: report file does not contain one of the required fields: Package

That doesn't work either.

https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports#Retrieving_a_backtrace_with_GDB
Using
$ gdb okular
(gdb) run

didn't cause a crash, as expected. Because if I start Okular manually and File -> Open... a PDF, it work's. It just crashes opening any PDF out of Dolphin.

You can download the 32,2 MiB file /var/crash/_usr_bin_okular.1000.crash from here:
https://drive.google.com/file/d/1FpJBgdAItH17iqXpPyVpoHkgJW1V22Re/view?usp=sharing
Comment 4 Albert Astals Cid 2020-06-20 10:02:33 UTC
Being a non Ubuntu user I don't really know what to do with that file.

Can you try this? (arm yourself with patience as things will go slow).

Install valgrind if you don't have it.

then from the terminal run

* killall dolphin (just to make sure you don't have any dolphin running)
* valgrind --trace-children=yes dolphin
* open a pdf from dolphin

This should hopefully give you some warning in the command line where you started valgrind.

Please attach that here.
Comment 5 catandras48+kde 2020-06-27 10:33:15 UTC
Dear Albert Astals Cid,
thank you a lot for your support and patience - I appreciate it. Sorry for my late response, I was in holiday the last week.
Okular doesn't crash anymore. I don't know what has changed since that seems to be the reason for the stability (I did some recommended OS-updates, nothing more). So I'm currently not able to reproduce the crashes.

But valgrind works perfectly, so I will continue with it whenever Okular crashes again.
Comment 6 catandras48+kde 2020-06-29 10:56:35 UTC
Created attachment 129757 [details]
valgrind log
Comment 7 catandras48+kde 2020-06-29 10:59:03 UTC
Hi!
Okular crashed again when opening a PDF from dolphin. The valgrind log is attached as 'valgrind log'.
Best regards,
Andreas
Comment 8 David Hurka 2020-06-29 17:14:29 UTC
Thanks. To me it tells that you have Okular 20.04.x (1.10.x) installed, but not the package okular-dbgsym. Can you install that package and wait for the next crash, or did you already try that?

The problem (as I read it) is somewhere in PageView::*Event(). We can read that it is something with event handlers and QScroller, probably QScroller got an invalid pointer somewhere. All the ??? make it difficult.

Do you remember whether Okular crashed when you tried to scroll, or did it crash immediately at opening the file?

QScreen is also involved. Unlikely, but possibly a reason why it crashes only on your system?. Do you have an uncommon screen arrangement? (Diagonal, negative DPI, whateverdontknow... ;) )
Comment 9 catandras48+kde 2020-06-29 18:37:00 UTC
Hello David!
Thank you also for your support.
When I try to install the package okular-dbgsym:

 andreas@t490:~$ sudo apt install okular-dbgsym
 [sudo] password for andreas:          
 Reading package lists... Done
 Building dependency tree       
 Reading state information... Done
 Some packages could not be installed. This may mean that you have
 requested an impossible situation or if you are using the unstable
 distribution that some required packages have not yet been created
 or been moved out of Incoming.
 The following information may help to resolve the situation:
 
 The following packages have unmet dependencies:
  okular-dbgsym : Depends: okular (= 4:19.12.3-2ubuntu1) but 4:20.04.0-0ubuntu1~ubuntu20.04~ppa3 is to 
 be installed
 E: Unable to correct problems, you have held broken packages.

Okular crashes immediatly after opening the file.

"uncommon screen arrangement":
Yes, I'm pretty sure you found the cause of the problem:
I use a the Lenovo UltraDockingStation and two FHD displays attached. One is horizontally 1920x1080 and the other is pivoted vertically 1080x1920.

When I detach the notebook, Okular opens successfully. When I switch off the vertical display, Okular also opens without crashing.

Well ... that's it. But how can I or we solve it?
Comment 10 David Hurka 2020-06-30 11:35:20 UTC
Thanks for the information.

>  The following packages have unmet dependencies:
>   okular-dbgsym : Depends: okular (= 4:19.12.3-2ubuntu1) but
>   4:20.04.0-0ubuntu1~ubuntu20.04~ppa3 is to be installed

I don’t know whether Kubuntu has another name for the correct package, okular-dbg or else... If you are patient, you can probably find it in aptitude or on https://packages.ubuntu.com

Downgrading to Okular 19.12.3 will probably not reproduce the bug, but it would save your workflow.

If you can’t install the debug symbols, I expect that someone else with enough screens can reproduce the bug and give us a detailed backtrace. With my second screen it doesn’t crash.

Maybe these informations could help:
* Does it crash if you open a second document from Okular, so it needs to create a new tab on the fly?
* A screenshot of your screen arrangement in System Settings. You gave us your screen arrangement, but maybe there is something special you consider normal.

Anyway, with the present information it should be possible to debug this with gdb.
Comment 11 catandras48+kde 2020-06-30 16:44:19 UTC
Created attachment 129797 [details]
display configuration
Comment 12 catandras48+kde 2020-06-30 16:46:30 UTC
Hi!
I searched at packages.ubuntu.com for "okular", "dbg", "debug" and so on in different variations, package names only and descriptions, but there was no sufficient result. The closest match was the package "kubuntu-debug-installer-dbg", which I installed, but valgrind showed the same result. So it wasn't the right package.

In the long run, I will downgrade to Okular 19.12.3, but until then I will provide you with information as good as I'm able of. If it helps to analyse the problem, I can offer you a screen-sharing session.

> * Does it crash if you open a second document from Okular, so it needs to
> create a new tab on the fly?
Yes.
When I start Okular manually via the Launcher, "File", "Open..." - it works. When I open a second PDF in the same instance, it crashes.

> * A screenshot of your screen arrangement in System Settings. You gave us
> your screen arrangement, but maybe there is something special you consider
> normal.
It's added as an attachment, "display configuration".
Comment 13 David Hurka 2020-06-30 20:32:55 UTC
Thanks for all the information! I see that you disabled the laptop screen. Still, only using my one external screen vertically doesn’t crash for me...

Crash at opening a new tab supports my theory that QScroller is set up differently when PageView is created when there is already a document loaded.

If I have some time soon, I might look into the PageView code related to QScroller. Maybe I will ask you about some gdb output about QScreen, but I don’t know what exactly yet.
Comment 14 Justin Zobel 2020-12-02 01:39:43 UTC
(In reply to David Hurka from comment #13)
> Thanks for all the information! I see that you disabled the laptop screen.
> Still, only using my one external screen vertically doesn’t crash for me...
> 
> Crash at opening a new tab supports my theory that QScroller is set up
> differently when PageView is created when there is already a document loaded.
> 
> If I have some time soon, I might look into the PageView code related to
> QScroller. Maybe I will ask you about some gdb output about QScreen, but I
> don’t know what exactly yet.

Hey David, have you had time to look at the code related to this issue?