Patch Name: PHCO_26005 Patch Description: s700_800 11.11 patch(1) patch Creation Date: 03/06/03 Post Date: 03/07/17 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 Automatic Reboot?: No Status: General Release Critical: Yes PHCO_26005: ABORT Category Tags: defect_repair general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHCO_26005 Symptoms: PHCO_26005: ( SR:8606176663 CR:JAGad45900 ) patch(1) dumps core with context diff files. ( SR:8606200278 CR:JAGad69462 ) patch(1) is unable to patch a single line data file. ( SR:8606311801 CR:JAGae74622 ) patch(1) is unable to patch newline insertions provided in + format. Defect Description: PHCO_26005: ( SR:8606176663 CR:JAGad45900 ) patch(1) dumps core with context diff files. The problem can be reproduced as: $ cat file1 line1 line2 line3 line4 line5 line6 $ cat diff_out *** file1 Mon Feb 14 07:54:16 2000 --- file2 Mon Feb 14 07:54:22 2000 *************** *** 2,4 **** line2 ! line3 line4 --- 2,4 ---- line2 ! newl3 line4 *************** *** 6 **** --- 6,7 ---- line6 + newl7 $ patch < diff_out Hmm... Looks like a new-style context diff to me... The text leading up to this was: -------------------------- |*** file1 Mon Feb 14 07:54:16 2000 |--- file2 Mon Feb 14 07:54:22 2000 -------------------------- Patching file file1 using Plan A... Hunk #1 succeeded at 2. Assertion failed: fillsrc==p_end+1 || fillsrc==repl_beginning, file pch.c, line 711 Abort(coredump) This happens due to incorrect condition checked at the time of updating fillsrc. Later on this leads to the assertion failure and dumps core. Resolution: The extra condition causing incorrect updation of fillsrc is now removed. ( SR:8606200278 CR:JAGad69462 ) When patch(1) is applied to a single line data file, it is unable to patch it. The problem can be reproduced as: $ cat file1 abcdef $ cat file2 123456 $ diff -c file1 file2 > diff_out $ patch < diff_out Hmm... Looks like a new-style context diff to me... The text leading up to this was: -------------------------- |*** file1 Wed Feb 2 03:18:44 2000 |--- file2 Wed Feb 2 03:18:49 2000 -------------------------- Patching file file2 using Plan A... Reversed (or previously applied) patch detected! Assume -R? [y] Hunk #1 succeeded at 1. done $ cat file2 123456 <=== It should be "abcdef" patch(1) was picking up incorrect context from the input file, which led to this behavior. Resolution: The variable to hold the context of input file had an incorrect initialization which is now corrected. ( SR:8606311801 CR:JAGae74622 ) patch(1) was not parsing the newline insertions correctly, which led to the wrong updation of data file. The problem can be reproduced as: $cat file1 line1 line2 $ cat diff_out *** file1 Sat Feb 12 05:03:17 2000 --- file2 Sat Feb 12 05:03:32 2000 *************** *** 1,2 **** --- 1,4 ---- line1 + + line2 $ patch < file3 Hmm... Looks like a new-style context diff to me... The text leading up to this was: -------------------------- |*** file1 Sat Feb 12 05:03:17 2000 |--- file2 Sat Feb 12 05:03:32 2000 -------------------------- Patching file file1 using Plan A... Hunk #1 succeeded at 1. done $ cat file1 line1 line2 This is wrong behavior as patch(1) is expected to insert two newlines after line1. Resolution: During parsing, care is taken to verify whether a blank space is provided after '+' symbol or not. Based on this, the pointer to the newline is updated. This ensures that the problem is fixed. Enhancement: No SR: 8606176663 8606200278 8606311801 Patch Files: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/patch what(1) Output: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: /usr/bin/patch: patch.c $Date: 2003/04/01 01:52:22 $Revision: r11.11 /2 PATCH_11.11 (PHCO_26005) pch.c $Date: 2003/05/25 23:24:53 $Revision: r11.11/3 PATCH_11.11 (PHCO_26005) $Revision: @(#) patch CUP11.11_BL2003_0603_3 PATCH_1 1.11 PHCO_26005 Tue Jun 3 07:19:53 PDT 2003 $ cksum(1) Output: OS-Core.CMDS-AUX,fr=B.11.11,fa=HP-UX_B.11.11_32/64,v=HP: 1630180630 49152 /usr/bin/patch Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: None Patch Package Size: 50 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_26005 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_26005.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_26005. 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_26005.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_26005.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_26005.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None