Patch Name: PHNE_30919 Patch Description: s700_800 11.00 Streams Pty cumulative patch Creation Date: 04/06/03 Post Date: 04/07/29 Hardware Platforms - OS Releases: s700: 11.00 s800: 11.00 Products: N/A Filesets: Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP Streams-TIO.STRTIO-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP OS-Core.UX-CORE,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP Automatic Reboot?: Yes Status: General Release Critical: Yes PHNE_30919: HANG PHNE_27821: PANIC PHNE_25914: HANG PHNE_25385: PANIC PHNE_24100: PANIC PHNE_22086: MEMORY_LEAK PHNE_21433: PANIC HANG PHNE_19616: MEMORY_LEAK PHNE_18878: PANIC Category Tags: defect_repair enhancement general_release critical panic halts_system memory_leak Path Name: /hp-ux_patches/s700_800/11.X/PHNE_30919 Symptoms: PHNE_30919: 1. { SR: 8606275682 CR: JAGae39758 } System hangs during reboot or shutdown.TOC dump shows the following stack trace. trace_swtch+0xd4 _sleep+0x390 streams_mpsleep+0xa8 ptem_close+0xc8 close_wrapper+0x38 csq_protect+0x120 osr_pop_subr+0x1fc osr_close_subr+0x324 hpstreams_close_int+0xd40 hpstreams_close+0x2c call_open_close+0x1f8 closed+0xb0 spec_close+0x54 vn_close+0x48 vno_close+0x20 closef+0x64 exit+0xed8 psig+0x440 syscall+0x74c $syscallrtn+0x0 PHNE_27821: 1. { SR: 8606268701 CR: JAGae32939 } Sysem panic in function ldtty_intimeout() Stack trace is as below: panic+0x14 report_trap_or_int_and_panic+0x80 interrupt+0x1d4 $ihndlr_rtn+0x0 spinlock+0x14 ldtty_intimeout+0x18 str_timeout+0xb8 invoke_callouts_for_self+0xc0 sw_service+0xb0 mp_ext_interrupt+0x134 ivti_patch_to_nop3+0x0 idle+0x550 swidle_exit+0x0 PHNE_25914: 1. { SR: 8606226042 CR: JAGad95113 } System hangs in ldtty_close(). 2. { SR: 8606222285 CR: JAGad91400 } Potential race window between wakeup in ldtty_intimeout() and sleep in ldtty_close(). 3. { SR: 8606220142 CR: JAGad89283 } grantpt system call sets the group id of pty dev incorrectly. PHNE_25385: System panics in ldtty_intimeout: the message is panic in ldtty_intimeout+0x18 PHNE_24100: System panics in ldtty_intimeout: the message is panic in ldtty_intimeout+0x18 : an ldtty timer deferenced a closed queue PHNE_22086: System hangs due to memory starvation when using pckt module. PHNE_21433: 1) System hangs during shutdown. 2) System panic when an application is transfering large amount of data under raw mode. PHNE_20094: When 32bit user application on 64bit platform uses getmsg() on Streams Pty, a 64bit data structure is returned instead of expected 32bit data structure. PHNE_19616: 1) Streams pty causes memory leak when end-user does not follow the operation procedure of master/slave pair. 2) Streams pty in UP Emulation mode leads worse performance to applicatons based on Streams Pty, such as rlogind. 3) System winds-down to what appears to be a complete system hang. PHNE_18878: Streams pty will panic under race conditions between master and slave drivers on MP systems. PHNE_14976: Streams pty did not work in UTF8 environment. This patch is an enhancement that provides UTF8 support PHNE_16155: System panic type 15 in pckt_rsrv in the Streams pty code. Defect Description: PHNE_30919: 1. { SR: 8606275682 CR: JAGae39758 } The wall command, which is normally invoked during reboot or shutdown, gets blocked as one of the (Streams) PTY devices is hung in close(2). This results in a system hang at reboot or shutdown. Resolution: The close(2) for streams pty has been modified so that it does not block. PHNE_27821: 1. { SR: 8606268701 CR: JAGae32939 } Pending timer pops after the terminal is closed, this timer causing the system to panic. Failure to do untimeout() on a timer caused the panic. Resolution: The data type of "timer-id" variable is modified to store larger values. Also the return value of function untimeout() is being verified. PHNE_25914: 1. { SR: 8606226042 CR: JAGad95113 } System hangs in ldtty_close() because the function ldtty_wsrv is not called from streams service routine as expected. Resolution: Now ldtty_wsrv() is directly called in ldtty_close() instead of calling it from streams service routine. If it fails, a timer is set to issue a wakeup(). 2. { SR: 8606222285 CR: JAGad91400 } User application hangs in PTY driver due to the race window between ldtty_intimeout() and ldtty_close().This problem is due the sleep() in ldtty_close() which has not been woken up. Resolution: The race window is removed by calling get_sleep_lock() before sleep(). 3. { SR: 8606220142 CR: JAGad89283 } grantpt system call is not setting the group id of the PTY device to group "tty". Resolution: Modified grantpt to set the group id of the PTY to group "tty". PHNE_25385: Race window between ldtty_close and ldtty_intimeout PHNE_24100: A timer was left active after a close. PHNE_22086: Memory leak when processing M_FLUSHR message in pckt module. Resolution: Free the undeallocated message used in processing M_FLUSHR message in pckt module. PHNE_21433: 1) Application may hang in ldtty close if there is some data inside ldtty module to drain. Shutdown thread is blocked and hangs when it tries to access the driver under ldtty module. 2) Race condition in ldtty module causes ldtty_sendraw to reuse a message block that has already been freed. Resolution: 1) Inside ldtty close routine, we add a call to service routine to drain outstanding data. 2) When a possible race condition is detected, ldtty_sendraw makes sure that it won't use the old message buffer which may have already been freed. PHNE_20094: When transparent ioctl is called, a M_IOCTL message is forwarded to Streams Pty master side. The first message block of M_IOCTL message, which contains iocblk data structure, is of different size on 32 and 64bit platform. Resolution: Add a register function in ptm driver. At STH, when a 32bit application is detected on 64bit platform, the registered function is called to convert 64bit iocblk data structure to 32bit in M_IOCTL msg. PHNE_19616: 1) When the slave driver is opened before the master driver, a preallocated message block (eof_msg_mp) is not freed before return error code. 2) UP Emulation mode of Streams Pty Driver binds Streams Pty based applications to monarch processor and causes performance problem. 3) High priority messages are queued in PCKT module by mistake. When this message are not processed in time, the module begins consuming huge memory. Resolution: 1) Check existence of master driver as soon as we try to open slave driver. Allocate eof_msg_mp only if master is already opened. 2) Streams Pty module now runs at QueuePair sync level, using shared/exclusive lock to protect critical data structure shared among master/slave drivers. 3) Process high priority msg in pckt_rput() function. PHNE_18878: The panic was caused by the master and slave drivers running on different processors and trying to access the same data structure. Resolution: The fix was to mutually exclude the master and slave drivers so that they cannot run at the same time and thus avoid the race condition. PHNE_14976: This patch is an enhancement for UTF8 support for STREAMS pty line discipline. PHNE_16155: The type 15 panic was caused the b_rptr pointer in the mblk being overwritten by a bad value when M_FLUSH was being processed and the system ran out of memory. Enhancement: No (superseded patches contained enhancements) PHNE_14976: This patch is an enhancement that provides UTF8 support SR: 8606207776 4701402487 5003429548 5003448738 5003427641 8606103315 8606128396 8606134024 8606152552 8606187489 8606220142 8606222285 8606226042 8606268701 8606275682 Patch Files: Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: /usr/conf/lib/libstrtio.a Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: /usr/conf/lib/libstrtio.a Streams-TIO.STRTIO-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: /usr/conf/strtio/pty.h /usr/include/sys/eucioctl.h OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: /usr/conf/lib/libhp-ux.a(strtio.o) OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: /usr/conf/lib/libhp-ux.a(strtio.o) OS-Core.UX-CORE,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lbin/chgpt what(1) Output: Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: /usr/conf/lib/libstrtio.a: PATCH_11.00: pty.c 04/05/18 12:36:00 PHNE_30919 PATCH_11.00: ptem.c 04/05/18 12:35:00 PHNE_30919 PATCH_11.00: pckt.o 1.4.118.5 00/07/25 PHNE_22086 PATCH_11.00: ldtty_euc.o 1.5.118.2 98/05/08 PHNE_1 4976 ldtty.c $Date: 2002/09/18 13:36:18 $Revision: r11ros /10 PATCH_11.00 (PHNE_27821) Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: /usr/conf/lib/libstrtio.a: PATCH_11.00: pty.c 04/05/18 12:36:00 PHNE_30919 PATCH_11.00: ptem.c 04/05/18 12:35:00 PHNE_30919 PATCH_11.00: pckt.o 1.4.118.5 00/07/25 PHNE_22086 PATCH_11.00: ldtty_euc.o 1.5.118.2 98/05/08 PHNE_1 4976 ldtty.c $Date: 2002/09/18 13:36:18 $Revision: r11ros /10 PATCH_11.00 (PHNE_27821) Streams-TIO.STRTIO-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: /usr/conf/strtio/pty.h: None /usr/include/sys/eucioctl.h: eucioctl.h 1.1 8/31/90 OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: /usr/conf/lib/libhp-ux.a(strtio.o): None OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: /usr/conf/lib/libhp-ux.a(strtio.o): None OS-Core.UX-CORE,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: /usr/lbin/chgpt: PATCH_11.00:chgpt.c r11ros/3 Sep 18 2002 PHNE_2782 1 $ PATCH/11.00:PHCO_95238 Dec 15 1998 14:52:14 $ cksum(1) Output: Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: 571131356 91156 /usr/conf/lib/libstrtio.a Streams-TIO.STRTIO2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: 3244684214 196136 /usr/conf/lib/libstrtio.a Streams-TIO.STRTIO-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32/64, v=HP: 1608656746 15146 /usr/conf/strtio/pty.h 3341160391 2931 /usr/include/sys/eucioctl.h OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_32,v=HP: 1875923947 86100 /usr/conf/lib/libhp-ux.a(strtio.o) OS-Core.CORE2-KRN,fr=B.11.00,fa=HP-UX_B.11.00_64,v=HP: 2061230053 105760 /usr/conf/lib/libhp-ux.a(strtio.o) OS-Core.UX-CORE,fr=B.11.00,fa=HP-UX_B.11.00_32/64,v=HP: 2406141837 262144 /usr/lbin/chgpt Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: PHNE_16155 PHNE_14976 PHNE_18878 PHNE_19616 PHNE_20094 PHNE_21433 PHNE_22086 PHNE_24100 PHNE_25385 PHNE_25914 PHNE_27821 Equivalent Patches: None Patch Package Size: 340 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 PHNE_30919 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHNE_30919.depot By default swinstall will archive the original software in /var/adm/sw/save/PHNE_30919. 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 PHNE_30919.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHNE_30919.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHNE_30919.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None