FAQ revision 24139
1219820Sjeff TOP 2 Version 3.4 3 4 William LeFebvre 5 and a cast of dozens 6 7 8FREQUENTLY ASKED QUESTIONS AND THEIR ANSWERS 9 10This FAQ is broken out in to several topics. 11 12 13GENERAL 14 15 1. "Where do I get the latest version of top?" 16 17The latest version of top is now available at the site "ftp.groupsys.com" in 18the directory "/pub/top". It is also available at "eecs.nwu.edu" in the 19directory "/pub/top". 20 21 2. "Is there a web page for top?" 22 23Not at this time, but I am planning one. When it is finally available, you 24will be able to find it at "www.groupsys.com." 25 26 3. "Is there a mailing list for top?" 27 28Currently there is a top developers mailing list that is used by beta 29testers and other people who help me port the program to various machines. 30I am planning a general mailing list for announcements and such, but it is 31not yet available. 32 33 4. "How can I find out when all these things become available?" 34 35Information about the web site and the mailing list will be made available 36in future distributions of top. New distributions will be announced on the 37appropriate Usenet newsgroups (including comp.sources.unix). 38 39 5. "Why does it take so long for a new version of top to go through the 40 beta test process?" 41 42This is completely my fault. I have just not had the time recently to give 43top the attention it deserves. I thank everyone for their patience, and I 44hope that with the recent changes in the direction of my career that I can 45spend more time on this. 46 47 6. "Top is not written in ANSI C. Do you ever plan to change that?" 48 49Top predates ANSI C by about 5 years. Yeah, it'll get "fixed" eventually. 50Probably in 3.5. 51 52 53CONFIGURING 54 55 7. "Configure said that it saw /proc and is recommending that I install top 56 setuid root. Is there any way around this? Is it safe?" 57 58There is no way around it. Complain to POSIX. Every effort has been made 59to make top a secure setuid program. However, we cannot guarantee that 60there are no security problems associated with this configuration. The 61places where top is most vulnerable are the builtin kill and renice 62commands. There is no internal top command that causes top to start a shell 63as a subprocess. Some SVR4 systems may contain a bug that enables a user to 64renice his own processes downward (to lower nice values that are more 65favorable for the process). This problem has been fixed for the Solaris 2.x 66modules, but may still exist in others. We will hopefully fix this up in 67the next release. 68 69 8. "Why is Configure a c-shell script? I thought c-shell scripts were 70 evil?" 71 72They are. :-) I'll probably be rewriting the Configure script for the 73next release. 74 75 76COMPILING 77 78 9. "We just upgraded our operating system to a new version and top broke. 79 What should we do?" 80 81Recompile it. Top is very sensitive to changes in internal kernel data 82structures. It is not uncommon for a new version of the operating system to 83include changes to kernel data structures. 84 85 86RUNNING 87 8810. "I just finished compiling top and it works fine for root, but when 89 I try to run it as a regular user it either complains about files 90 it can't open or it doesn't display all the information it should. 91 Did I do something wrong?" 92 93Well, you're just not done. On many operating systems today, access to 94many of the kernel memory devices and other system files is restricted to 95either root or a particular group. The Configure script figures this out 96(usually) and makes sure that the "intsall" rule in the Makefile will 97install top so that anyone can run it successfully. However, you have to 98*install* it first. Do this with the command "make install". 99 10011. "Top is (not) displaying idle processes and I don't (do) want it to." 101 102This default has only changed about a dozen times, and I finally got tired 103of people whining about it. Go read the manual page for the current version 104and pay special attention to the description of the "TOP" environment 105variable. 106 10712. "We have so much memory in our machine that the memory status display 108 (the fourth line) ends up being longer than 80 characters. This 109 completely messes up top's output. Is there a patch?" 110 111Most modules have been changed to use new memory formatting functions which 112will display large values in terms of megabytes instead of kilobytes. This 113should fix all occurences of this problem. If you encounter a system where 114this large memory display overflow is still occurring, please let me know 115(send mail to <wnl@groupsys.com>). Also note that newer versions of top can 116use columns beyond 79, and understand window resizes. So you can always 117make your window bigger. 118 11913. "I tried to compile top with gcc and it doesn't work. I get 120 compilation errors in the include files, or I get an executable that 121 dumps core, or top displays incorrect numbers in some of the displays. 122 What's wrong?" 123 124Gnu CC likes very much to use its own include files. Not being a gcc 125expert, I can't explain why it does this. But I can tell you that if you 126upgrade your operating system (say from Solaris 2.4 to Solaris 2.5) after 127installing gcc, then the include files that gcc uses will be incorrect, 128especially those found in the "sys" directory. Your choices are: (1) 129rebuild and reinstall the "standard" include files for gcc (look for a 130script in the distribution called "fixincludes"), (2) compile machine.c 131with "CFLAGS=-I/usr/include" then make the rest of the object files 132normally, or (3) use "cc". 133 13414. "The cpu state percentages are all wrong, indicating that my machine is 135 using 95% system time when it is clearly idle. What's wrong?" 136 137This can happen if you compiled with gcc using the wrong include files. 138See the previous question. 139 140 141SUNOS PROBLEMS 142 14315. "I tried compiling top under SunOS version 4.1.x and it got compile time 144 errors. Is there a patch?" 145 146If you try compiling top in a "System V environment" under SunOS (that is, 147/usr/5bin is before /usr/bin on your path) then the compilation may fail. 148This is mostly due to the fact that top thinks its being compiled on a 149System V machine when it really isn't. The only solution is to put /usr/bin 150and /usr/ucb before /usr/5bin on your path and try again. 151 152 153SVR4-derived PROBLEMS 154 15516. "When I run top on my SVR4-derived operating system, it displays all 156 the system information at the top but does not display any process 157 information (or only displayes process information for my own 158 processes). Yet when I run it as root, everything works fine." 159 160Your system probably uses the pseudo file system "/proc", which is by 161default only accessible by root. Top needs to be installed setuid root on 162such systems if it is going to function correctly for normal users. 163 164 165SOLARIS PROBLEMS 166 16717. "Under Solaris 2, when I run top as root it only shows root processes, 168 or it only shows processes with a PID less than 1000. It refuses to 169 show anything else. What do I do?" 170 171You probably compiled it with /usr/ucb/cc instead of the real C compiler. 172/usr/ucb/cc is a cc front end that compiles programs in BSD source-level 173compatability mode. You do not want that. Make sure that /usr/ucb is not 174on your path and try compiling top again. 175 17618. "Under Solaris 2, I compiled top using what I am sure is the correct 177 compiler but when I try to run it it complains about missing dynamic 178 libraries. What is wrong?" 179 180Check to see if you have LD_LIBRARY_PATH defined in your shell. If you do, 181make sure that /usr/ucblib is not on the path anywhere. Then try compiling 182top again. 183 18419. "Under Solaris 2, when I try to run top it complains that it can't open 185 the library "libucb.so.1". So I changed the LIBS line in m_sunos5.c 186 to include -R/usr/ucblib to make sure that the dynamic linker will look 187 there when top runs. I figured this was just an oversight. Was I 188 right?" 189 190No, you were not right. As distributed, top requires NO alterations for 191successful compilation and operations under Solaris 2.0, 2.1, 2.2, 2.3, 2.4, 192and 2.5. You probably compiled top with /usr/ucb/cc instead of the real C 193compiler. See FAQ #10 for more details. 194 195 196SCO PROBLEMS 197 19820. "When I try to run Configure, it complains about a syntax error." 199 200Some versions of SCO's csh do not understand the syntax "$<". This breaks 201Configure. You'll just have to hack around it for now: the Configure script 202is going to be completely redone in the near future anyway. 203 204 205SVR42 PROBLEMS 206 20721. "The load average and memory displays don't work right. Why?" 208 209This is a known bug with the svr42 module. The problem has been traced down 210to a potential bug in the "mem" driver. The author of the svr42 module is 211working on a fix. 212 213 214STILL STUCK 215 21622. I'm still stuck. To whom do I report problems with top?" 217 218The most common problems are caused by top's sensitivity to internal kernel 219data structures. So make sure that you are using the right include files, 220and make sure that you test out top on the same machine where you compiled 221it. Sun's BSD Source Compatability Mode is also a common culprit. Make 222sure you aren't using either /usr/ucb/cc or any of the libraries in 223/usr/ucblib. Finally, make sure you are using the correct module. If there 224does not appear to be one appropriate for your computer, then top probably 225will not work on your system. 226 227If after reading all of this file and checking everything you can you are 228still stuck, then send mail to "wnl@groupsys.com". I will answer your mail 229when I have time. Please bear with me in that regard! If it looks like the 230problem is machine-specific, I will forward the report along to the module's 231author. If you would like to converse directly with the module author, the 232authors' names are listed at the beginning of the module .c file in the 233"machine" directory. 234