Bug 480596 - Freeze when fetching metadata for large text document
Summary: Freeze when fetching metadata for large text document
Status: CONFIRMED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: tooltip (show other bugs)
Version: 23.08.4
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-31 11:22 UTC by Fabian Esposito
Modified: 2024-02-01 03:56 UTC (History)
4 users (show)

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


Attachments
doc file I was able to find, supposedly not copyrighted, that presents such problem with dolphin. (533.50 KB, application/msword)
2024-01-31 11:22 UTC, Fabian Esposito
Details
Flamegraph (67.89 KB, image/avif)
2024-01-31 11:51 UTC, Nicolas Fella
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Esposito 2024-01-31 11:22:32 UTC
Created attachment 165392 [details]
doc file I was able to find, supposedly not copyrighted, that presents such problem with dolphin.

# SUMMARY

Dolphin hangs and becomes unresponsive for tens of second when having to show informations (Either panel or tooltip) of old and heavy .doc files (Although I have encountered the problem with file less than 1mb in size) as well when opening the propriety tab of the same .doc files. I don't have the calligra's word thumbnailer enabled.
I'm able to click and select the files when I have both the tooltip and the information panel disabled without having Dolphin become unresponsive, although if I then open the propriety tab, it hangs again.  

# STEPS TO REPRODUCE
1. Click or navigate to one of these old .doc files using Dolphin (if tooltip or information panel are enabled is enough) 
2. Open the propriety tab of the same file (if tooltip and information panel are disabled)

# OBSERVED RESULT
Dolphin hangs and becomes unresponsive for tens of second, the time seems slightly related to the size of the file.

# EXPECTED RESULT
As with the other .doc file or newer .docx , selecting the file and showing the information (either via thumbnail or panel information) should be seamless.

# SOFTWARE/OS VERSIONS
Linux:  Fedora 39
KDE Plasma Version: 5.27.10
KDE Frameworks Version: 5.113.0
Qt Version: 5.15.12
Comment 1 Nicolas Fella 2024-01-31 11:51:20 UTC
Created attachment 165394 [details]
Flamegraph

The document is fairly large and the amout of words in it is calculated, which takes a while
Comment 2 Fabian Esposito 2024-01-31 11:56:43 UTC
Yes, but only with .doc file I've encountered this type of freeze; and just with some of them. Never encountered this problem even with .docx of tens of MB in size.
Comment 3 Nicolas Fella 2024-01-31 12:08:59 UTC
.docx is handled by another codepath, which reads the word count property from the document metadata instead of going over the whole file.

That said "file" is able to quickly give me the word count for your document, so there should be a way for us to do that too
Comment 4 Fabian Esposito 2024-01-31 12:31:46 UTC
I see, that should be perfect then. Since I'm very far to be an expert, I wanted in any case make a test, I hope I'm not mistaken.

As for now, using the .doc that I sent for example, Dolphin gives as "Number of words: 46.361" and  "Number of lines: 3.946". Opening the file in OnlyOffice, it reports as Dolphin 3.946 number of lines (Or better, paragraphs) but 44.827 number of words that I would presume is the correct number of words. So I've tried to obtain the number of words of the .doc file by piping the output of antiword to wc -w and it gave me instantaneously the right result of 44.827 number of words; so, as of now Dolphin also seems to read incorrectly those information for these kind of files. But maybe it's just a coincidence. Would also this problem be fixed with "That said "file""?
Comment 5 fanzhuyifan 2024-02-01 03:56:46 UTC
Maybe in general we want to use a separate thread for querying non-essential information?