Bug 64798
Summary: | new kernel errata hangs xosview on SMP (2.4.18-4smp) | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | greg hosler <greg> | ||||
Component: | xosview | Assignee: | Than Ngo <than> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 7.3 | CC: | bugs.michael, i.a.cameron, joshua.bakerlepain, juergen, mhfrey, wtogami | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2002-05-29 17:42:09 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
greg hosler
2002-05-12 23:18:28 UTC
The same with "kernel-2.4.18-4.athlon" on single-processor mainboard. I just saw the [RHBA-2002:085-11] advisory, and the following looks suspicious: 3. Problem description: . . . Finally, bugs in the vsnprintf implementation and in the way the kernel reads the /proc/stat file are now fixed. Note that xosview is having trouble reading /proc/stat (from the strace above). The problem seems to be in fs/proc/proc_misc.c where, in the latest release, 1000000000 is added to kstat_irqs(i). I removed that change, and now xosview works fine. I have a single processor Athlon system. The kernel bug adding 1 billion to the interrupt counts is fixed in 64825, but xosview should not hang due to the size of the /proc/stat increasing. Reassigned to xosview. I ran xosview under ddd and note the following. In linux/cpumeter.cpu, CPUMeter::countCPUs() it is reading STATFILENAME (/proc/stats) by way of a C++ ifstream: ifstream stats( STATFILENAME ); . . char buf[1024]; . . stats.getline(buf, 1024); The problem is that the new intr line in the stats file is now much longer than it used to be (due to the kernel change). The new line length is 2476 characters, and the 1st read of that line will return the 1st 1024 bytes, but the 2nd read does not pick up the rest of the line. My C++ is not good enough to realize whether this is a bug in C++, or whether getline is supposed to work this way. one potential quick fix is to change all the proc/stat buffers from 1024 to 4096, but honestly, this is a crock, and a longer line will still cause this problem. (e.g. bugger size interrupt values). Someone familiar w/ C++ could probably address this problem. I note that my suggested fix above (changing the buffer size) is not correct fix. After applying it, I note that xosview runs at 100% cpu usage. Have not investigated why though. Created attachment 58464 [details]
patch which uses std::string
If that doesn't help, the cpumeter.cc code contains much pointer arithmetic using C-style char buffers and string functions. Hard to mix with C++ strings. I just uploaded src and i386 packages to incoming.redhat.com/libc6 with a modified buffer size of 4096. I didn't think that increasing the buffer size was the real proper way to fix it, but it's a reasonable temporary solution. I sent the xosview author the patch too, although it would seem that he's probably aware of this by now having read this bug report. Ho hum, will continue to use the version I have modified on the SMP machine here until RH get a solution out. For information: I had a reply from the author, he has updated the CVS tree and changed the buffer length to 4096 in linux/cpumeter.cc. Note to self: Read bugzilla *before* bothering to do anything yourself! It's fixed in 1.8.0-3 We are seeing this exact behavior on RedHat 9.0 with kernel-smp-2.4.20-18.9 and either xosview-1.8.0-11 or the rawhide xosview-1.8.0-15, except that in the strace it is hanging on reading /proc/interrupts instead of /proc/stat. |