RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1856159 - ksysguardd: "internal buffer too small to read /proc/cpuinfo" when running with many CPUs [rhel-7.9.z]
Summary: ksysguardd: "internal buffer too small to read /proc/cpuinfo" when running wi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: kde-workspace
Version: 7.8
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jan Grulich
QA Contact: Desktop QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-13 01:25 UTC by Anthony
Modified: 2023-10-06 21:04 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-10 12:57:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshoot (493.11 KB, image/jpeg)
2020-07-13 01:25 UTC, Anthony
no flags Details
screenshoot (459.48 KB, image/jpeg)
2020-07-13 01:33 UTC, Anthony
no flags Details
sosreport (11.23 MB, application/x-xz)
2020-07-13 01:34 UTC, Anthony
no flags Details
sosreport (18.67 MB, application/x-xz)
2020-07-13 01:37 UTC, Anthony
no flags Details
screenshoot1 (4.34 MB, image/jpeg)
2020-07-16 02:59 UTC, Anthony
no flags Details
screenshoot2 (5.58 MB, image/jpeg)
2020-07-16 03:00 UTC, Anthony
no flags Details
screenshoot3 (4.84 MB, image/jpeg)
2020-07-16 03:01 UTC, Anthony
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:5006 0 None None None 2020-11-10 12:57:40 UTC

Description Anthony 2020-07-13 01:25:30 UTC
Created attachment 1700752 [details]
screenshoot

Description of problem:
When running ksysguard with many CPUs, ksysguardd will post in the logs "internal buffer too small to read /proc/cpuinfo".


Version-Release number of selected component (if applicable):
ksysguard-4.11.19-15


Steps to Reproduce:

1.Run ksysguard on a machine with many CPUs.


Actual results:

Customers use the latest version of KsysGuard, but there are still problems. The following feedback from customers:

1. The version of ksysguard in RHEL7.8 is already newer than the version provided by the RHSA-2019:2141 patch, but the problem still exists.

2. The bug mentioned that the buffer size of 32kb is not enough and needs to be increased to 128kb. However, from the RHSA-2019: 2141 and the latest ksysguardd-4.11.19-15 source code, it is still 32KB.

The buffer size for reading /proc/cpuinfo appears to be controlled by a constant definition on Line 42 in ksysguard/ksysguard/Linux/cpuinfo.c:
#define CPUINFOBUFSIZE (32 * 1024)
[source: https://github.com/KDE/ksysguard/blob/master/ksysguardd/Linux/cpuinfo.c]
This sets the cpuinfo buffer to 32 kB, which is not enough to read cpuinfo from large CPUs (/proc/cpuinfo for 40 CPUs is around 50 kB). The obvious fix would be to increase the buffer size to 128 kB.

3. According to the description of the bug, can the buffer size definition of cpuinfo.c in the ksysguardd-4.11.19-15 source code be modified to 128, and provide an installation package for us to install and see?
#define CPUINFOBUFSIZE (32 * 1024)
change into
#define CPUINFOBUFSIZE (128 * 1024)

Thanks

BR/ Yuliang Li

Comment 3 Anthony 2020-07-13 01:33:26 UTC
Created attachment 1700753 [details]
screenshoot

Comment 4 Anthony 2020-07-13 01:34:34 UTC
Created attachment 1700754 [details]
sosreport

Comment 5 Anthony 2020-07-13 01:37:15 UTC
Created attachment 1700755 [details]
sosreport

Comment 6 Jan Grulich 2020-07-13 06:03:48 UTC
This issue has been fixed already. I double-checked bug 1611762 and there is a patch applied doing exactly what you described. The bug has been verified by QA on a machine with 256 cores and worked.

You said you checked the source code, have you seen patch kde-workspace-ksysguard-increase-cpu-buffer.patch? The fix is not in the tarball with kde-workspace, but there is a patch applied during the build.

Also from the build log:
+ echo 'Patch #72 (kde-workspace-ksysguard-increase-cpu-buffer.patch):'
Patch #72 (kde-workspace-ksysguard-increase-cpu-buffer.patch):
+ /usr/bin/cat /builddir/build/SOURCES/kde-workspace-ksysguard-increase-cpu-buffer.patch
+ /usr/bin/patch -p1 -b --suffix .ksysguard-increase-cpu-buffer --fuzz=0
patching file ksysguard/ksysguardd/Linux/cpuinfo.c

Comment 7 Jan Grulich 2020-07-13 06:14:50 UTC
Alternatively, instead of hardcoding maximum size, we can backport upstream fix below:

https://github.com/KDE/ksysguard/commit/031bd7603e39dad609a597c64ff66fbec418d999

I guess the customer has more CPU cores than even the updated value.

Comment 11 Anthony 2020-07-16 02:59:23 UTC
Created attachment 1701320 [details]
screenshoot1

Comment 12 Anthony 2020-07-16 03:00:18 UTC
Created attachment 1701321 [details]
screenshoot2

Comment 13 Anthony 2020-07-16 03:01:02 UTC
Created attachment 1701322 [details]
screenshoot3

Comment 22 Michael Boisvert 2020-08-05 18:44:58 UTC
I can verify the expected functionality in https://bugzilla.redhat.com/show_bug.cgi?id=1856159#c18 is what I can verify using kde-workspace-4.11.19-16.el7_9.

Comment 23 Michael Boisvert 2020-08-05 18:47:16 UTC
I tested the packages on a machine with 256 CPUs.

Comment 26 errata-xmlrpc 2020-11-10 12:57:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (kde-workspace bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5006


Note You need to log in before you can comment on or make changes to this bug.