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
Created attachment 199754 [details, diff] Patch that fixed the issue for me.
Alternatively, here's the patch from upstream: http://procps.cvs.sourceforge.net/viewvc/procps/procps/top.c?r1=1.132&r2=1.134
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
vapier: please include this in a revbump or state objections to me committing it?
i dont have a problem with adding the changes from upstream, so feel free to do that ...
committed as 3.2.8-r1
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?
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? >
*** Bug 354977 has been marked as a duplicate of this bug. ***