Bug 503206 - Infinite loop in KZip::openArchive (causes high CPU usage by thumbnail kioworker)
Summary: Infinite loop in KZip::openArchive (causes high CPU usage by thumbnail kiowor...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-karchive
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.13.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2025-04-23 04:50 UTC by 717379060
Modified: 2025-05-11 16:33 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 6.14.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 717379060 2025-04-23 04:50:26 UTC
when i booting up the system,the thumbnail always use  8.3% cpu usuage 

in top 
2172 lu0se     25   5  874428 108408  82332 R  99.7   0.7  14:11.90 kioworker

in plasma-systemmonitor 
kioworker 8.3% /usr/lib/kf6/kioworker /usr/lib/qt6/plugins/kf6/kio/thumbnail.so thumbnail  local:/run/user/1000/plasmashelloPiQQo.8.kioworker.socket
Comment 1 oddmarks 2025-04-23 07:44:03 UTC
I'm experiencing the exact same issue!  I found that this is happening due to Word .doc files in my Desktop and Downloads directories. The kioworker processes keep endlessly  call:
```
lseek(17, 47025, SEEK_SET)              = 47025
```
while 17 is the fd of .doc file, 47025 is always the same. Killing kioworker provides temporary relief, but after reboot it comes back if file is still there.
Comment 2 August Wikerfors 2025-04-23 12:41:56 UTC
This is caused by a regression in karchive 6.13.0 which I've bisected to https://invent.kde.org/frameworks/karchive/-/commit/53ec010a9470ee09b132af9e42f674dc3c2ffa90 ("kzip: Remove repeated code for header detection"). A minimal reproducer is to create a file with `echo -n AAAAPKAA > a.doc` and then view the directory containing this file in Dolphin.
Comment 3 August Wikerfors 2025-04-23 13:01:57 UTC
Moving this to the karchive product as that seems to be where the root cause is
Comment 4 Azhar Momin 2025-05-01 13:41:54 UTC
(In reply to August Wikerfors from comment #2)
> This is caused by a regression in karchive 6.13.0 which I've bisected to
> https://invent.kde.org/frameworks/karchive/-/commit/
> 53ec010a9470ee09b132af9e42f674dc3c2ffa90 ("kzip: Remove repeated code for
> header detection"). A minimal reproducer is to create a file with `echo -n
> AAAAPKAA > a.doc` and then view the directory containing this file in
> Dolphin.

This was fixed here: https://invent.kde.org/frameworks/karchive/-/commit/e20f869437fc4dd979e36e8f18403a03920b148e#b4eda17820eeddb776071ebfa7e9a9f89f8b250d_813_835