Patch Name: PHCO_29072 Patch Description: s700_800 11.11 top(1) cumulative patch Creation Date: 04/02/03 Post Date: 04/03/03 Hardware Platforms - OS Releases: s700: 11.11 s800: 11.11 Products: N/A Filesets: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: No (superseded patches were critical) PHCO_24481: ABORT Category Tags: defect_repair enhancement general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHCO_29072 Symptoms: PHCO_29072: ( SR:8606305416 CR:JAGae68464 ) top(1) displays truncated command names and sometimes blank in the COMMAND field of the output. ( SR:8606331621 CR:JAGae92741 ) top(1) with -f option reads from stdin. PHCO_27131: ( SR:8606247886 CR:JAGae14286 ) top(1) was unable to display the information of all the cpus in a machine with more number of cpus. PHCO_25204: ( SR:8606233010 CR:JAGae02235 ) top(1) displays wrong values for the average cpu time spent in each state on a multiprocessor machine. ( SR:8606202912 CR:JAGad72086 ) top(1) command is showing, the resident size of the process as, more than actual size of the process. PHCO_24481: ( SR:8606184562 CR:JAGad53769 ) This patch is a member of a set of patches needed to enable the HP-UX Processor Sets product (PROCSETS). When PROCSETS product is installed, it will install the full set of required patches for that product, including this patch. If the HP-UX Processor Sets product is not installed, this change will have no impact on your system. ( SR:8606146989 CR:JAGad16332 ) The output functionality of top(1) is not correct. ( SR:8606174220 CR:JAGad43466 ) top(1) gets bus error while iCOD changes the number of active processors in the system. Defect Description: PHCO_29072: ( SR:8606305416 CR:JAGae68464 ) top(1) uses a pstat syscall to capture the command name associated with the process currently active on the system. The syscall has a limitation of returning only the first 62 characters of the command line. So if the command name goes beyond 62 characters in command line, top(1) gets truncated command name and displays as it is. The problem can be reproduced as follows: 1. Create a directory with name length of 61 characters $ mkdir `perl -e 'print "a" x 61'` 2. Create a executable $ cat > file.c << _EOF #include int main() { while(1); return 0; } _EOF $ cc -o file file.c 3. Copy this executable to the above created directory $ cp file `perl -e 'print "a" x 61'` 4. Run the executable in background from its current location $ `perl -e 'print "a" x 61'`/file & 5. Run top(1) and see the entry corresponding to the above process $ top . . 0 pts/4 9313 usr 243 24 1708K 160K run 0:16 94.69 54.22 f . . The command name displayed is 'f', but actually it should be 'file' 6. Kill the process $ kill -s SIGKILL $! Resolution: top(1) has been updated to use a different syscall to capture the command name. The new syscall is able to return upto 1020 characters of the command line. This enables top(1) to display the complete and accurate command name. ( SR:8606331621 CR:JAGae92741 ) top(1) with -f option reads stdin for screen-control command given by user. This behavior make top(1) unusable in some scripts. The problem can be reproduced as follows. 1. Create an at job file $ cat > job <<_EOF rm -rf /tmp/out_put1 /tmp/out_put2 top -s1 -d10 -n1000 -f /tmp/out_put1 echo "Testing top" > /tmp/out_put2 _EOF 2. Run the file job using at $ at -f job now 3. Wait for 10 seconds $ sleep 10 4. Check for the existence of /tmp/out_put2 $ ls /tmp/out_put2 /tmp/out_put2 not found The file /tmp/out_put2 does not exist, since top(1) eats up few characters from next command line treating them as screen-control commands. In case output is redirected to a file, the screen-control command are not supported. Resolution: top(1) does not read from stdin, if -f option is provided. PHCO_27131: ( SR:8606247886 CR:JAGae14286 ) On a machine with more number of processors, top(1) was unable to display the information of all the cpus in the system. Also top(1) was not showing individual processes information. Resolution: Added a new option '-w', to display individual cpu information in place of individual process information, to toggle between them. Also user can traverse through the cpu information using the keys 'j', 'k' and 't'. PHCO_25204: ( SR:8606233010 CR:JAGae02235 ) top(1) is showing wrong values for average cpu time spent by all the active processors in each state. The average cpu time spent in each state was calculated by storing the sum of cpu time spent in each state by all the active processors in a variable and dividing it with number of active processors. There was a overflow occuring while assigning sum of cpu times spent by all the active processors. This problem can occur only on machines, up for long time. Ex: Cpu states: CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 0 0.31 6.7% 0.0% 0.0% 93.3% 0.0% 0.0% 0.0% 0.0% 1 0.34 14.4% 0.0% 6.7% 78.8% 0.0% 0.0% 0.0% 0.0% 2 0.44 54.8% 0.0% 6.7% 38.5% 0.0% 0.0% 0.0% 0.0% 3 0.57 83.7% 0.0% 1.0% 15.4% 0.0% 0.0% 0.0% 0.0% 4 0.29 80.8% 0.0% 0.0% 19.2% 0.0% 0.0% 0.0% 0.0% 5 0.54 34.6% 0.0% 2.9% 62.5% 0.0% 0.0% 0.0% 0.0% 6 0.54 25.0% 0.0% 6.7% 68.3% 0.0% 0.0% 0.0% 0.0% 7 0.30 97.1% 0.0% 0.0% 2.9% 0.0% 0.0% 0.0% 0.0% --- ---- ----- ----- ----- ----- ----- ----- ----- ----- avg 0.42 0.0% 0.0% 0.0% 100.0% 0.0% 0.0% 0.0% 0.0% Resolution: The variable, used for storing the sum is changed to to take care of large values. Now the overflow is not occuring and top(1) is giving correct output. ( SR:8606202912 CR:JAGad72086 ) top(1) is showing the resident size of the process, more than the actual size of process, which is wrong. This was because, the total size of process was calculated as sum of text, data and stack, where as the resident size of the process includes sizes of private regions of uarea, shared memory, mmap regions and io mappings in addition to the resident text, data and stack. Ex: System: condor Wed Aug 22 21:18:42 2001 Load averages: 2.00, 2.00, 2.01 116 processes: 111 sleeping, 4 running, 1 zombie Cpu states: LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS 2.00 57.7% 0.0% 42.3% 0.0% 0.0% 0.0% 0.0% 0.0% Memory: 68012K (43412K) real, 58424K (42600K) virtual, 443276K free Page# 1/8 TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND ? 5828 root 187 0 56K 140K run 16336:24 80.65 80.51 syncp3 ? 29608 vts 195 20 216K 232K run 2534:49 18.05 18.02 mailx pts/15 17520 vts 178 20 776K 4880K run 0:00 1.48 0.38 top In the above example, top(1) is giving the resident size of a process as more than the size of the process. Resolution: Now the code of top(1) is changed to include, private regions of uarea, shared memory, mmap regions and io mappings to the actual size of the process. PHCO_24481: ( SR:8606184562 CR:JAGad53769 ) This patch contains minor enhancements required to support the HP-UX Processor Sets product. Resolution: Enhancements to top(1) to utilize changes in mpctl() when Processor Sets product is enabled. Two new options "-p" and "-P" are added to top(1) to display processor sets information. The "-p" option displays the load averages and process state break down for both the specified psetid and the system. It also displays the processes running on the specified psetid. "-P" option displays the psetid to which the processor is assigned for all processors whose cpu state information is displayed. Also the psetid to which the process is bound for all the processes that are displayed. ( SR:8606146989 CR:JAGad16332 ) The output functionality of top(1) is not correct. Resolution: Now the code is modified to correct the output functionality of top(1). ( SR:8606174220 CR:JAGad43466 ) If the number of active processors in the system changes ( Using iCOD ) on the fly, top gets bus error because of a critical section of code in top. If the activation of processors occurs while top(1) is in that critical section it will dump. Resolution: Now the code is modified to take care of changes in the number active processors while top(1) is in the critical section of the code. Enhancement: No (superseded patches contained enhancements) PHCO_29072: Enhancements were delivered in a patch this one has superseded. Please review the Defect Description text for more information. SR: 8606146989 8606174220 8606184562 8606202912 8606233010 8606247886 8606305416 8606331621 Patch Files: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/top OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/top.1 what(1) Output: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/top: top.c $Date: 2004/01/28 15:25:27 $Revision: r11.11/1 1 PATCH_11.11 (PHCO_29072) $Revision: @(#) all R11.11_BL2004_0203_1 PATCH_11.11 PHCO_29072 Tue Feb 3 08:35:29 PST 2004 $ OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: /usr/share/man/man1.Z/top.1: None cksum(1) Output: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: 1022326363 40960 /usr/bin/top OS-Core.CORE-ENG-A-MAN,fr=B.11.11,fa=HP-UX_B.11.11_32/64, v=HP: 1428683124 3905 /usr/share/man/man1.Z/top.1 Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHCO_27131 PHCO_25204 PHCO_24481 Equivalent Patches: None Patch Package Size: 60 KBytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHCO_29072 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_29072.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_29072. If you do not wish to retain a copy of the original software, include the patch_save_files option in the swinstall command above: -x patch_save_files=false WARNING: If patch_save_files is false when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. For future reference, the contents of the PHCO_29072.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_29072.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_29072.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None