Bug 465006 - Dolphin hangs when hovering cursor on a dictionary file (mobi)
Summary: Dolphin hangs when hovering cursor on a dictionary file (mobi)
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: panels: information (show other bugs)
Version: 22.12.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-29 20:36 UTC by tiklii
Modified: 2023-02-06 17:35 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.104


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tiklii 2023-01-29 20:36:16 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Download a dictionary file in mobi format (for kindles).
2. Have 'Information' panel toggled (press F11) on.
3. Hover over the file using mouse or using keyboard.

OBSERVED RESULT
Dolphin hangs for tens of seconds if the file is on ssd. If on hdd it just keeps hanging and have to kill it.
During this time baloo_filemetadata_temp_extractor uses excessive cpu and memory. Here's a screenshot: https://i.imgur.com/4M6DyYi.png 

EXPECTED RESULT
Doesn't hang

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I am using Dolphin on sway (arch linux).
Here are some files to test on:
https://archive.org/details/Oxford_Dictionary_kindle/ (this one gives a longer hang time)
https://github.com/jmdict-kindle/jmdict-kindle/releases/tag/3.0.20220129
Comment 1 Bug Janitor Service 2023-02-06 02:03:17 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/85
Comment 2 Méven 2023-02-06 02:07:28 UTC
(In reply to Bug Janitor Service from comment #1)
> A possibly relevant merge request was started @
> https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/85

This does not fully fix the issue, although should reduce the hang.

The lib mobi is simply too slow and the metadata extraction should be called out of main process of dolphin as should any IO bound process.
This is a well known architecture issue, that I have been trying to fix for some time.
Comment 3 Méven 2023-02-06 14:03:38 UTC
Git commit 995c9d0126f63f1142f9a3dde10e42d2ab50dbc8 by Méven Car.
Committed on 06/02/2023 at 13:53.
Pushed by meven into branch 'master'.

Mobi extractor: only extract what is asked

M  +29   -27   src/extractors/mobiextractor.cpp

https://invent.kde.org/frameworks/kfilemetadata/commit/995c9d0126f63f1142f9a3dde10e42d2ab50dbc8
Comment 4 Méven 2023-02-06 14:51:01 UTC
Git commit 8eb423d2792f7634d838a0e3b57eebcffefe12df by Méven Car.
Committed on 06/02/2023 at 14:50.
Pushed by meven into branch 'kf5'.

Mobi extractor: only extract what is asked

M  +29   -27   src/extractors/mobiextractor.cpp

https://invent.kde.org/frameworks/kfilemetadata/commit/8eb423d2792f7634d838a0e3b57eebcffefe12df