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

            Bug ID: 514580
           Summary: ksystemstats_intel_helper crashes with SIGFPE
                    (division by zero) on Intel GPU
    Classification: Plasma
           Product: plasmashell
      Version First master
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: generic-crash
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: 1.0

Created attachment 188503
  --> https://bugs.kde.org/attachment.cgi?id=188503&action=edit
Crash is caused by unguarded division in IntelHelper.cpp:  engineCounters[...]
/ enginesPerClass[...]  enginesPerClass[...] can be zero on some systems,
causing SIGFPE.  A minimal patch is attached

SUMMARY
ksystemstats_intel_helper crashes with SIGFPE (division by zero) on Intel GPU

STEPS TO REPRODUCE
1. Use an Intel GPU where some engine classes report zero engines
2. Start Plasma or any component using ksystemstats (e.g. System Monitor
widgets)
3. ksystemstats_intel_helper crashes immediately

OBSERVED RESULT
ksystemstats_intel_helper crashes with SIGFPE due to division by zero.
As a result, GPU statistics stop working.

EXPECTED RESULT
ksystemstats_intel_helper should not crash when enginesPerClass[] is zero.
It should safely handle missing or unsupported engine classes.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.x

ADDITIONAL INFORMATION
Crash happens in ksystemstats_intel_helper (Plasma system statistics backend),
not in plasmashell UI itself.

Root cause:
Unconditional division by enginesPerClass[] without checking for zero.

A tested fix is to guard all divisions, e.g.:

engineCounters[class] / enginesPerClass[class]
→
enginesPerClass[class] ? (engineCounters[class] / enginesPerClass[class]) : 0

Patch tested locally, fully resolves the crash.

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

Reply via email to