Patch Name: PHCO_24160 Patch Description: s700_800 11.00 patch(1) patch Creation Date: 01/12/11 Post Date: 01/12/21 Hardware Platforms - OS Releases: s700: 11.00 s800: 11.00 Products: N/A Filesets: OS-Core.CMDS-AUX,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: No Category Tags: defect_repair general_release Path Name: /hp-ux_patches/s700_800/11.X/PHCO_24160 Symptoms: PHCO_24160: 1. "patch -p0 < " dumps core on some but not all files. PHCO_20818: When a diff file of zero lines of context is applied to a file, patch(1) dumps core with an "Assertion failed" error. When the reverse diff of zero lines of context is applied to a file, patch command reports "Unexpected end of hunk" error. Defect Description: PHCO_24160: 1."patch -P0 < " core dumps on some but not all files even after applying PHCO_20818. One can reproduce the problem like the following: $ cat css line1 line2 line3 line4 line5 line6 line7 line8 line9 $ cat r2.patch Index: css diff -c css:1.25.2.1 css:1.25.2.2 *************** *** 1,7 **** line1 line2 line3 ! line4 line5 line6 line7 --- 5,14 ---- newline5 newline6 newline7 ! newline8 ! newline9 ! newline10 ! newline12 newline13 newline14 *************** *** 7,9 **** --- 14,19 ---- line8 line9 + + + newline16 $ ../patch -p0 < r2.patch Hmm... Looks like a new-style context diff to me... The text leading up to this was: -------------------------- |Index: css |diff -c css:1.25.2.1 css:1.25.2.2 -------------------------- Patching file css using Plan A... Hunk #1 succeeded at 5. Assertion failed: fillsrc==p_end+1 || fillsrc==repl_beginning, file pch.c, line 719 Abort(coredump) Resolution: The core dump was due to context diff file Parsing. This problem is rectified and the modified Patch(1) is thoroughly tested. PHCO_20818: The diff file of zero lines of context is not interpreted correctly because of the missing conditions. The previous related defect fix did not consider this case. Resolution: More conditions are added to make sure that the diff file of zero lines of context is interpreted correctly and patching is done appropriately. SR: 8606176663 8606110338 Patch Files: OS-Core.CMDS-AUX,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/patch what(1) Output: OS-Core.CMDS-AUX,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/bin/patch: $Revision: 80.1.1.7 $ PATCH_11_00: patch.o pch.o inp.o util.o version.o hp ux_rel.o 01/12/11 cksum(1) Output: OS-Core.CMDS-AUX,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 2939429042 53248 /usr/bin/patch Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHCO_20818 Equivalent Patches: None Patch Package Size: 70 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_24160 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_24160.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_24160. 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_24160.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_24160.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_24160.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None