Patch Name: PHCO_26916 Patch Description: s700_800 11.00 more(1) cumulative patch Creation Date: 02/06/14 Post Date: 02/06/24 Hardware Platforms - OS Releases: s700: 11.00 s800: 11.00 Products: N/A Filesets: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: Yes PHCO_26916: HANG PHCO_24693: ABORT Category Tags: defect_repair enhancement general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHCO_26916 Symptoms: PHCO_26916: 1. In a multibyte locale environment, more(1) hangs when an invalid character is entered and erased by backspace, while entering command from stdin. 2. In a multibyte locale environment, more(1) gives wrong output when input is from stdin. 3. more(1) is not dealing properly with the file containing large number of escape characters (^A). PHCO_24693: 1. more(1) dumps core while reading binary files. 2. The more(1) and page(1) commands exits with error message "Value too large to be stored in data type" when used on large files(>2GB). 3. when LANG=ja_JP.eucJP, more(1) does not display the entire file when the input is fed exactly 8K of data. Defect Description: PHCO_26916: 1. more(1) hangs when an invalid character(e.g. ^K) is entered and deleted by pressing backspace under multibyte locale environment at !command prompt. For example: $export LANG=ja_JP.SJIS $ll -R /dev | more [....snipped....] crw-rw-rw- 1 root other [...snipped....] !abc^K <== This is entered from keyboard Now if ^K is deleted by pressing backspace, it hangs. Resolution: more(1) checks for the number of column position of the characters to be deleted. When a character is an invalid character(^K) more(1) is not able to recognize it under multibyte environment. The code is changed to recognize it properly. 2. For some multibyte locales, more(1) is eating up some characters from the output when the input is from stdin. For example: $export LANG=ja_JP.eucJP $wc file 66 93 3269 file $more file | wc 66 93 3269 $more < file | wc 62 90 3142 ^^ ^^ ^^^^ (The above output is wrong) Resolution: more(1) was checking wrongly for the EOF while reading a file. In a multibyte environment, it was not able to process the input properly when a multibyte character spans across the boundary of two successive input buffers. The code is changed to take care of this situation. If an incomplete character is encountered at the boundary of input buffer, it is carried forward to next buffer. 3. more(1) behaves incorrectly when the input file contains large number of escape characters (^A). For example: 3.1 it hangs after reading certain number of escape characters (^A) from the input file. 3.2 The terminal session gets killed with pipe error message when more(1) takes input from stdin and the output is piped to wc(1) command. $more < file | wc Pipe error Connection closed. Resolution: There was special handling for escape character (^A) at the time of input processing by more(1). Now this handling is delayed till the output processing. PHCO_24693: 1. more(1) command core dumps or gives "read error" when viewing the binary files. For example: $ more [....snipped.....] memory fault(core dump) Resolution: more(1) reads blocks of data. A variable is used to count the number of control characters read in each block. This variable was not initialized prior to each block being read, as a consequence more(1) tries to write additional blocks which eventually results in a core dump. Now more(1) code has been changed to properly initialize the variable before reading each block. Though more(1), dumping core while viewing binary files is resolved, there are few problems still exist when reading binary files. As more(1) uses the terminal interfaces, some of the control characters in the binary data file could be interpreted by the terminals. We advise users to use the more(1) utility to view text files and use other commands such as xd(1) for viewing binary data files. 2. more(1) and page(1) do not support large files. For example: $ ll test_file -rw-rw-rw- 1 root sys 2560000000 [...snipped..] $more test_file [..Snipped..]Value too large to be stored in data type Resolution: more(1) is a 32 bit binary and the data types used initially couldn't handle values greater than 2GB. Hence when the size of the file exceeds 2GB, more(1) used to report the above mentioned error message and exit. Now, more(1) is enhanced to support large files. The variables are replaced with new variables capable of holding large values. 3. In ja_JP.eucJP locale, more(1) corrupts data when fed exactly 8k. For example: Assume the data_file is having exactly 8K. $export LC_ALL=ja_JP.eucJP $wc data_file 652 653 26718 data_file $more data_file | wc 652 653 26718 $cat data_file | more | wc 399 401 16383 ^^^^^^^^^^^^^ (The above output is wrong) Similarly, the problem can be reproduced by the following: $export LANG=ja_JP.eucJP $ dd if=data_file bs=8191 2>/dev/null | more | wc 652 653 26718 $ dd if=data_file bs=8192 2>/dev/null | more | wc 399 401 16383 $ dd if=data_file bs=8191 2>/dev/null | more | wc 652 653 26718 Resolution: When reading the multi-byte file, if the character is part of a multi-byte and is less than mb_cur_max value of the locale, more(1) used to interpret those characters as EOF and used to come out assuming it has read all the contents of the input file resulting in partial display of the input file. Now more(1) is changed to read the multi-byte input files properly. The new more(1) is tested thoroughly under different multi-byte locales. SR: 8606232376 8606233175 8606227499 8606223261 8606174802 8606168690 1653276253 8606192627 Patch Files: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/more.cat /usr/bin/more /usr/bin/page what(1) Output: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lib/nls/msg/C/more.cat: None OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/more: $Revision: 82.3.2.26 $ PATCH_11_00: ch.o command.o decode.o help.o input.o line.o linenum.o main.o option.o os.o output .o position.o prim.o screen.o signal.o tags. o ttyin.o hpux_rel.o 02/06/14 OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/page: $Revision: 82.3.2.26 $ PATCH_11_00: ch.o command.o decode.o help.o input.o line.o linenum.o main.o option.o os.o output .o position.o prim.o screen.o signal.o tags. o ttyin.o hpux_rel.o 02/06/14 cksum(1) Output: OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 1024240630 4286 /usr/lib/nls/msg/C/more.cat OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 797269267 86016 /usr/bin/more OS-Core.CMDS-MIN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 797269267 86016 /usr/bin/page Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHCO_24693 Equivalent Patches: None Patch Package Size: 120 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_26916 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_26916.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_26916. 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_26916.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_26916.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_26916.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None