Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 279819

Summary: [patch] sys-process/procps - top ignores .toprc
Product: Gentoo Linux Reporter: Michal Terepeta <michal.terepeta>
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: chris, djsmiley2k, dsowen, gentoobugs.troxor, infowolfe, orzel, quasi
Priority: High Keywords: Inclusion
Version: unspecified   
Hardware: AMD64   
OS: Linux   
URL: https://bugzilla.redhat.com/show_bug.cgi?id=161449
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Patch that fixed the issue for me.

Description Michal Terepeta 2009-07-31 19:24:02 UTC
Apparently there is a problem in procps that results in top being unable to read the configuration file created by itself. The issue is described in redhat's bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=161449
where the patch fixing it is available.

Reproducible: Always

Steps to Reproduce:
1. Remove any previous .toprc file.
2. Run top, change the configuration and save it.
3. Run top again - it falls back to its defaults ignoring the changes made in 2.

Actual Results:  
Top runs with default settings (i.e. like no toprc existed).

Expected Results:  
Top runs according to the configuration.

Some basic info about my system:
CHOST=x86_64-pc-linux-gnu
CFLAGS=-march=core2 -O2 -fno-ident -pipe
CXXFLAGS=-march=core2 -O2 -fno-ident -pipe
LDFLAGS=-Wl,-O1,--hash-style=gnu,--as-needed
Comment 1 Michal Terepeta 2009-07-31 19:25:04 UTC
Created attachment 199754 [details, diff]
Patch that fixed the issue for me.
Comment 2 David Owen 2009-12-11 04:35:05 UTC
Alternatively, here's the patch from upstream:

http://procps.cvs.sourceforge.net/viewvc/procps/procps/top.c?r1=1.132&r2=1.134
Comment 3 Thomas Capricelli 2009-12-13 01:30:05 UTC
hello. i guess my problem is the same, or at least very close.

I've had it on ~amd64 for some times. Strangely it only happens with my root account (bash) and not with my normal user (tcsh).
i can copy the working .toprc from my user account and then it works as root. But if start 'top' and do 'W' to save it again, without having made any modification, then it writes an invalid .toprc and starting top again gives an ugly default (b&2) top.
diff says:
--- ~user/.toprc  2009-10-13 03:23:26.438334049 +0200
+++ .toprc      2009-12-13 02:06:07.425338794 +0100
@@ -1,14 +1,14 @@
 RCfile for "top with windows"          # shameless braggin'
 Id:a, Mode_altscr=0, Mode_irixps=1, Delay_time=3.000, Curwin=0
-Def    fieldscur=AEHIOQTWKNMbcdfgjplrSuvyzX
+       fieldscur=AEHIOQTWKNMbcdfgjplrSuvyzX
        winflags=32697, sortindx=10, maxtasks=0
        summclr=1, msgsclr=1, headclr=3, taskclr=1
-Job    fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX
+       fieldscur=ABcefgjlrstuvyzMKNHIWOPQDX
        winflags=62777, sortindx=0, maxtasks=0
        summclr=6, msgsclr=6, headclr=7, taskclr=6
-Mem    fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX
+       fieldscur=ANOPQRSTUVbcdefgjlmyzWHIKX
        winflags=62777, sortindx=13, maxtasks=0
        summclr=5, msgsclr=5, headclr=4, taskclr=5
-Usr    fieldscur=ABDECGfhijlopqrstuvyzMKNWX
+       fieldscur=ABDECGfhijlopqrstuvyzMKNWX
        winflags=62777, sortindx=4, maxtasks=0
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-01-25 01:12:13 UTC
vapier: please include this in a revbump or state objections to me committing it?
Comment 5 SpanKY gentoo-dev 2010-01-25 02:25:34 UTC
i dont have a problem with adding the changes from upstream, so feel free to do that ...
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2010-01-25 03:06:13 UTC
committed as 3.2.8-r1
Comment 7 Chris Henhawke 2010-06-30 15:00:58 UTC
I just tested both versions on a brand new install of amd64, without success.  Top reverts to the default config when run as root.

Portage 2.1.8.3 (hardened/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0, 2.6.32-hardened-r9 x86_64)

CFLAGS="-O2 -march=core2 -msse4 -mcx16 -mpopcnt -msahf -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
LDFLAGS="-Wl,-O1"

Did I do something wrong?
Comment 8 troxor 2010-07-26 20:21:31 UTC
This is probably a gcc bug; with CFLAGS="-O0", .toprc is used properly. There is a similar bug here -> https://bugzilla.redhat.com/show_bug.cgi?id=161449

(In reply to comment #7)
> I just tested both versions on a brand new install of amd64, without success. 
> Top reverts to the default config when run as root.
> 
> Portage 2.1.8.3 (hardened/linux/amd64/10.0, gcc-4.4.3, glibc-2.11.2-r0,
> 2.6.32-hardened-r9 x86_64)
> 
> CFLAGS="-O2 -march=core2 -msse4 -mcx16 -mpopcnt -msahf -fomit-frame-pointer
> -pipe"
> CXXFLAGS="${CFLAGS}"
> CHOST="x86_64-pc-linux-gnu"
> LDFLAGS="-Wl,-O1"
> 
> Did I do something wrong?
> 

Comment 9 Jeroen Roovers (RETIRED) gentoo-dev 2011-02-15 15:20:01 UTC
*** Bug 354977 has been marked as a duplicate of this bug. ***