Bug 496390 - Okular crashes when using the typewriter annotation-tool if anything is typed when the input field is not focused.
Summary: Okular crashes when using the typewriter annotation-tool if anything is typed...
Status: RESOLVED WAITINGFORINFO
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 24.08.3
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-11-17 18:55 UTC by Joel Köper
Modified: 2024-11-21 18:50 UTC (History)
1 user (show)

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


Attachments
gdb trace of the Okular crash (92.57 KB, text/plain)
2024-11-17 18:55 UTC, Joel Köper
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Köper 2024-11-17 18:55:32 UTC
Created attachment 175885 [details]
gdb trace of the Okular crash

SUMMARY

Trying to type text while the input window of the textwriter tool isn't in focus and then trying to save the text Okular crashes with a segfault (doesn't seem to matter what is entered either in the input field or while not focused)


STEPS TO REPRODUCE
1. Open a PDF in Okular
2. Create a text-box using the typewriter annotation-tool
3. type something with the keyboard while the input window is out of focus
4. save the entered text (may be empty, doesn't matter)

OBSERVED RESULT

Okular crashes

EXPECTED RESULT

Okular doesn't crash

SOFTWARE/OS VERSIONS

Operating System: Garuda Linux 
Window manager: Hyprland 0.45.0
KDE Plasma Version: 6.2.3
KDE Frameworks Version: 6.8.0
Qt Version: 6.8.0
Kernel Version: 6.11.8-zen1-2-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 × AMD Ryzen 5 7600X 6-Core Processor
Memory: 30.5 GiB of RAM
Graphics Processor: AMD Radeon RX 7800 XT

ADDITIONAL INFORMATION

Also reproduced on my vanilla Arch laptop running cosmic
Comment 1 Joel Köper 2024-11-17 19:02:52 UTC
I noticed that it only happens if you enter a number while unfocused.
Comment 2 Albert Astals Cid 2024-11-20 22:44:46 UTC
3. type something with the keyboard while the input window is out of focus

What does this mean?

Out of focus compared to what? Who has the focus?
Comment 3 Joel Köper 2024-11-20 23:54:28 UTC
The Typewriter input dialog pops up as an additional window.
If I, however, focus the main okular window because the window focus follows my mouse, and enter a number (No input is written to the input field) which selects, for example, the Underline tool if 3 is pressed.

I had a friend try to reproduce this on KDE (Manjaro) but there the window focus is forced on the Input field, so it is never possible to select another tool while initially creating the Typewriter text and, seemingly, thus doesn't crash okular.
Comment 4 Albert Astals Cid 2024-11-20 23:56:43 UTC
Exactly, if window manager you are using doesn't enforce the restriction that the focus is only on the dialog and can't be on the window behind it, you need to file a bug against them.
Comment 5 Joel Köper 2024-11-20 23:58:23 UTC
I thought about that too, but I think that this still shouldn't cause okular to crash, but I understand, that this wouldn't be as high a priority.
Comment 6 Albert Astals Cid 2024-11-21 18:50:50 UTC
What you are doing is "impossible", there is no need to protect the code against impossible things. The bug is in the Window Manager that let's you do impossible things.