Bug 263853 - ksysguardd segfaults when /proc/vmstat is not readable
Summary: ksysguardd segfaults when /proc/vmstat is not readable
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: ksysguardd (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 269385 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-21 12:06 UTC by Vincent de Phily
Modified: 2011-03-25 13:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent de Phily 2011-01-21 12:06:08 UTC
Version:           unspecified (using KDE 4.5.5) 
OS:                Linux

Upstreamed from gentoo bug http://bugs.gentoo.org/show_bug.cgi?id=351899

Ksysguardd crashes when /proc/vmstat is not readable (this happens with some grsec kernel configurations). Apparently this happens because ksysguard/ksysguardd/Linux/stat.c fails to notice the read failed, and uses uninitialized memory afterwards.

Reproducible: Always

Steps to Reproduce:
Install a grsec kernel with proper config (see gentoo bug), or simply "chmod 400 /proc/vmstat" (kill the current ksysgardd to let it reopen the file).


Actual Results:  
* ksysguardd crashes, and is restarted by some GUI program many times per second
* the CPU/mem/etc monitors in ksysgard GUI are empty

Expected Results:  
Basic:
* provide dummy values instead of crashing
* show diagnostic message

Bonus points:
* Fallback to alternate source of information ({a,h,}top work fine with an unreadable /proc/vmstat)
* Bubble up the diagnostic message to the GUI
Comment 1 John Tapsell 2011-03-18 17:50:49 UTC
Git commit 20330a2c486c5c4fb84d3e95089327cc3d08dc9a by John Tapsell.
Committed on 18/03/2011 at 17:50.
Pushed by johnflux into branch 'master'.

Do not crash if we cannot open vmstat

BUG:263853

M  +35   -36   ksysguard/ksysguardd/Linux/stat.c     

http://commits.kde.org/kde-workspace/20330a2c486c5c4fb84d3e95089327cc3d08dc9a
Comment 2 John Tapsell 2011-03-25 13:19:51 UTC
*** Bug 269385 has been marked as a duplicate of this bug. ***
Comment 3 John Tapsell 2011-03-25 13:20:19 UTC
Git commit 1c3239acd617a7d436974f4274b1fa8c8d71879f by John Tapsell.
Committed on 18/03/2011 at 17:50.
Pushed by johnflux into branch 'KDE/4.6'.

Do not crash if we cannot open vmstat

BUG:263853

M  +35   -36   ksysguard/ksysguardd/Linux/stat.c     

http://commits.kde.org/kde-workspace/1c3239acd617a7d436974f4274b1fa8c8d71879f