https://bugs.kde.org/show_bug.cgi?id=524101

            Bug ID: 524101
           Summary: KIO thumbnailer uses ~200% CPU when generating
                    thumbnail for a PE32+ Windows executable
    Classification: Applications
           Product: dolphin
      Version First unspecified
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: view-engine: icons mode
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

# KDE Dolphin / KIO thumbnailer uses ~200% CPU on a single Windows PE32+
executable

## Summary

Dolphin's thumbnail generation for **"Microsoft Windows Executable"** files can
cause two `kioworker` processes to consume almost 100% CPU each when processing
a particular PE32+ executable.

The problem is reproducible with the same file. Disabling the Dolphin preview
type **"Microsoft Windows Executable"** completely resolves the problem.

## System

* Ubuntu 26.04 LTS (Kubuntu)
* Kernel: `7.0.0-29-generic`
* KDE Plasma: `6.6.5`
* Dolphin: `25.12.3`
* KIO: `5.116.0-2`
* Architecture: x86_64

## Problem file

The problematic file is a Windows PE executable:

```text
MyMemoryDB_64Bit.dbg
```

`file` reports:

```text
PE32+ executable for MS Windows 4.00 (GUI), x86-64, 12 sections
```

Size:

```text
44 MiB (45,770,182 bytes)
```

The file is a self-developed Lazarus/Delphi application containing an SQLite
database application. It was originally built for Microsoft Windows.

## Reproduction

1. Enable Dolphin's preview option for **"Microsoft Windows Executable"**.
2. Open the directory containing the file:

```text
/mnt/INTENSO_USB/5_fix_grosse_Ordner_fixed/5fix_A5_Sicherung_Mitte_September/
```

3. Dolphin starts thumbnail generation.
4. CPU usage rises dramatically.
5. Two `kioworker` processes are created.

Observed processes:

```text
/usr/lib/x86_64-linux-gnu/libexec/kf6/kioworker \
/usr/lib/x86_64-linux-gnu/qt6/plugins/kf6/kio/thumbnail.so \
thumbnail ...
```

Both processes consumed approximately 98% CPU each.

The relevant process information was:

```text
38364  ... 98.2 % ... kioworker ... thumbnail.so thumbnail
38366  ... 98.1 % ... kioworker ... thumbnail.so thumbnail
```

Dolphin itself consumed only approximately 0.8% CPU.

## Further investigation

`lsof` showed that both thumbnail workers had the same directory and the same
executable file open:

```text
/mnt/INTENSO_USB/5_fix_grosse_Ordner_fixed/5fix_A5_Sicherung_Mitte_September
```

and:

```text
/mnt/INTENSO_USB/5_fix_grosse_Ordner_fixed/5fix_A5_Sicherung_Mitte_September/MyMemoryDB_64Bit.dbg
```

Both workers therefore appeared to be processing the same file simultaneously.

The workers also loaded Windows executable thumbnail support, including:

```text
windowsexethumbnail.so
windowsimagethumbnail.so
```

## Control test

The problem is completely reproducible:

* With `MyMemoryDB_64Bit.dbg` present: high CPU usage and loud fan.
* Rename the file to `MyMemoryDB_64Bit.dbg.bak`: CPU usage immediately returns
to normal.
* Rename it back to `MyMemoryDB_64Bit.dbg`: high CPU usage returns when the
directory is opened in Dolphin.

This strongly indicates that the file itself triggers the problem in the
Windows executable thumbnailer.

## Workaround

In Dolphin, disabling the preview type:

**"Microsoft Windows Executable"**

completely resolves the problem.

Other thumbnail types can remain enabled.

After disabling this preview type:

* the problematic directory can be opened normally;
* CPU usage remains normal;
* the fan remains quiet;
* the `kioworker` CPU consumption no longer occurs.

## Expected behavior

If a Windows PE executable cannot be thumbnailed successfully, the thumbnailer
should fail gracefully and return no thumbnail, rather than entering a state
where two KIO workers consume almost 100% CPU each indefinitely.

Ideally, thumbnail generation should also avoid processing the same file
concurrently in multiple workers unless this is intentional.

## Additional information

The executable is a legitimate application developed with Lazarus/Delphi and is
approximately 44 MiB in size.

The issue therefore may be related to a particular characteristic of this PE
file rather than to all Windows executables. I can provide the executable to
the developers if a sample file is useful for reproducing the problem.

The issue was discovered because Dolphin continued to have background activity
even after its visible window had been closed. The Dolphin daemon remained
running and the associated KIO thumbnail workers continued consuming CPU.

The problem disappears when the Windows executable thumbnail preview is
disabled.

Workaround: Disabling "Microsoft Windows Executable" previews in Dolphin
completely prevents the problem.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to