Patch Name: PHCO_30618 Patch Description: s700_800 11.04 (VVOS) Pthread library cumulative patch Creation Date: 04/03/23 Post Date: 04/03/29 Hardware Platforms - OS Releases: s700: 11.04 s800: 11.04 Products: N/A Filesets: OS-Core.C-MIN-32ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP OS-Core.C-MIN-64ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP OS-Core.CORE-64SLIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP OS-Core.CORE-SHLIBS,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP Automatic Reboot?: No Status: General Release Critical: Yes PHCO_30618: HANG Based on HP-UX Patch PHCO_29959: HANG PHCO_29761: ABORT HANG Based on HP-UX Patch PHCO_29108: HANG Based on HP-UX Patch PHCO_26960: ABORT PHKL_18945: ABORT Based on HP-UX Patch PHKL_17935: ABORT This defect could result in an application core dump. Based on HP-UX Patch PHKL_17709: ABORT This defect could result in an application hang. Category Tags: defect_repair enhancement general_release critical halts_system Path Name: /hp-ux_patches/s700_800/11.X/PHCO_30618 Symptoms: PHCO_30618: Ported HP-UX patch PHCO_29959 to VVOS Based on HP-UX patch PHCO_29959: ( SR:8606338187 CR:JAGae99161 ) Under certain circumstances, a multi-threaded application that has a thread suspending itself while depending upon a different thread to resume it, could experience a hang. PHCO_29761: Ported HP-UX patch PHCO_29108 to VVOS Based on HP-UX patch PHCO_29108: ( SR:8606307008 CR:JAGae70043 ) Java processes can hang occasionally. ( SR:8606294128 CR:JAGae57868 ) Thread can get cancelled even though cancellation is disabled. ( SR:8606314230 CR:JAGae77005 ) The pthread library does not export two functions that are useful to the Java virtual machine. Based on HP-UX patch PHCO_26960: ( SR:8606245135 CR:JAGae11610 ) Application fails with internal error in pthread library when the kernel patch that implements a new light weight syscall is not applied. ( SR:8606249251 CR:JAGae15645 ) Application aborts when a detached thread forks child process. ( SR:8606232793 CR:JAGae02021 ) Private mutex lock throughput not acceptable for some applications with heavy mutex contention. ( SR:8606255251 CR:JAGae19578 ) pthread_cancel() fails to cancel a thread in certain conditions. ( SR:8606259437 CR:JAGae23755 ) pthread_mutex_destroy() intermittently returns EBUSY even when there are no threads accessing the mutex. Based on HP-UX patch PHCO_23792: libpthread didn't support initialized TLS variables. PHCO_21164: Ported HP-UX patch PHCO_19666 to VVOS Based on HP-UX patch PHCO_19666: Libc was unable to use thread callbacks, which are needed for multithreaded performance enhancements. JAGab19980 PHKL_18945: Ported HP-UX patch PHKL_17935 to VVOS Based on HP-UX patch PHKL_17935: SR: 1653296962 CR: JAGaa94129 An application that calls pthread_create() can terminate with the following error when running on a system with heavy memory usage: Pthread internal error: message: __alloc_stack() Based on HP-UX patch PHKL_17709: When calling pthread_[cond,mutex,rwlock]_init(), subsequent use of these objects can cause the process or thread to hang if the error is not properly checked, or structures associated with these routines are not properly initialized. Based on HP-UX patch PHKL_17294: If you have installed Patch PHKL_17390 and you use java and the pthread asynchronous cancellation feature you may experience incorrect program behavior -- possible program aborts, hangs, etc. If you do not use the pthreads asynchronous cancellation feature, this patch is not required. Based on HP-UX patch PHKL_16239: SCHED_TIMESHARE thread priorities degrade over time and with cpu usage. SCHED_NOAGE provides a scheduling policy where the priority does not degrade. In order to utilize the SCHED_NOAGE feature, patch PHKL_16236 must be installed along with PHKL_16239. The order of installation is not important. If this feature will not be used, PHKL_16236 is not necessary. Based on HP-UX patch PHKL_16368: System peformance degrades when thread spinlock contention occurs. libpthread enhancement to improve thread spinlock performance and overall system performance by lowering the amount of bus traffic during spinlock contention. Defect Description: PHCO_30618: Ported HP-UX patch PHCO_29959 to VVOS Based on HP-UX patch PHCO_29959: ( SR:8606338187 CR:JAGae99161 ) Pthread library keeps track of thread suspensions using internal suspend count, Suspend count is incremented when a thread gets suspended and decremented when thread is resumed. The problem occurs when a thread suspends itself inside a loop while waiting for a different thread to resume it. The thread suspending itself may never get resumed since the suspend count maintained inside the library will not match the actual suspension state of the thread. Resolution: The internal counter that maintains thread's suspend count has been fixed to avoid this situation. PHCO_29761: Ported HP-UX patch PHCO_29108 to VVOS Based on HP-UX patch PHCO_29108: ( SR:8606307008 CR:JAGae70043 ) During normal operation, the Java Virtual Machine may suspend a thread. When a thread gets suspended, it could be holding internal pthread resources. This can cause a deadlock. Resolution: Solution is to ensure target does not get suspended while holding internal pthread resources. ( SR:8606294128 CR:JAGae57868 ) The cancellation operation (pthread_cancel) can race with cancel enable/disable (pthread_setcancelstate). Resolution: While cancelling a thread, detect that the thread has now disabled cancellation. ( SR:8606314230 CR:JAGae77005 ) The pthread library does not export two functions that are useful to the Java virtual machine. Resolution: libpthread will now export the two symbols Based on HP-UX patch PHCO_26960: ( SR:8606245135 CR:JAGae11610 ) If SIGSYS is ignored by the application, the sigtimedwait() system call finds no pending SIGSYS after the check for new light weight system call fails with ENOSYS. This results in pthread internal error because SIGSYS was expected. Resolution: The check for new syscall is aptly handled so that internal error doesn't occur. ( SR:8606249251 CR:JAGae15645 ) In the child process forked from a detached thread, the first thread in the exit path references a stale pointer. This results in application aborting in pthread library. Resolution: The stale pointer is reset in the child fork cleanup path. ( SR:8606232793 CR:JAGae02021 ) When large number of threads contend for a mutex, it results in contention for the internal lock of the mutex, thereby exacerbating the mutex contention seen by the application. Resolution: The pthread mutex unlock path has been modified to release internal lock before waking up a waiting thread, and thus reducing contention for the internal lock and improving performance. The performance changes can take effect only if the POSIX real-time restrictions on threads waiting on a mutex are relaxed. This is done by disabling the mutex handoff mode for real-time threads and can be done using pthread_mutex_disable_handoff_np() or pthread_mutexattr_disable_handoff_np() or by setting the environment variable PTHREAD_DISABLE_HANDOFF=ON. By default these performance changes are disabled. The first API pthread_mutex_disable_handoff_np() is for process wide disabling of handoff mode in all mutexes. So is the environment variable PTHREAD_DISABLE_HANDOFF. The pthread_mutexattr_disable_handoff_np() takes an argument pointer to pthread_mutexattr_t and can be used to disable handoff mode for a particular mutex. The pthread_mutex_disable_handoff_np() has no arguments and has to be called by the main thread before any new threads are created. "Handoff mode" is used to strictly adhere to POSIX real-time characteristics, when real-time threads waiting on a mutex are woken up. If the application does not have any real-time threads acquiring mutex locks, or if the application does not rely on strict real-time behavior of real-time threads waiting on a mutex, the mutex handoff mode can be disabled, to take advantage of these performance changes. ( SR:8606255251 CR:JAGae19578 ) There is a race condition in thread cancellation path in pthread library, because of which pthread_cancel() fails to cancel a thread. Resolution: The race condition in the cancellation path is removed by protecting the internal cancellation structure with a spinlock. ( SR:8606259437 CR:JAGae23755 ) The problem with pthread_mutex_destroy() is attributed to the fact that, pthread_mutex_unlock() does not keep track of the number of waiters accurately. The mutex cannot be destroyed when there are waiters, and hence EBUSY is returned by pthread_mutex_destroy(). Resolution: The change introduced in this patch will accurately keep track of all the waiters. Based on HP-UX patch PHCO_23792: Initialized TLS variable support. PHCO_21164: Ported HP-UX patch PHCO_19666 to VVOS Based on HP-UX patch PHCO_19666: Multithreaded performance enhancement JAGab19980 PHKL_18945: Ported HP-UX patch PHKL_17935 to VVOS Based on HP-UX patch PHKL_17935: SR: 1653296962 CR: JAGaa94129 The pthread_create() path uses mmap() to allocate a stack. pthread_create() checks for a NULL return. However, mmap() returns MAP_FAILED if it cannot perform the allocation. Typically what happens is that the subsequent mprotect() will fail to setup the guard page, then munmap() fails when trying to clean up on the error return path, generating an "INTERNAL ERROR" message and a core dump from the library. Also, since the mmap() failure check passes even if it fails (we're not looking for the correct return value), pthread_create() doesn't return an error. Instead, it terminates with "INTERNAL ERROR." Resolution: pthread_create() now checks for MAP_FAILED and returns the error instead of failing with "INTERNAL ERROR.". Based on HP-UX patch PHKL_17709: Structures associated with pthread_[cond,mutex,rwlock]_init() are not being initialized correctly. This causes a call to these routines to return EBUSY. Resolution: We no longer check for "cookie" values to validate these objects. We unconditionally initialize them. Based on HP-UX patch PHKL_17294: A kernel interface change required that we save a register in a new location when the application enters the kernel via the trap path. The kernel change was made in patch PHKL_17390. Resolution: The pthreads library must now look in the new location for the register value in this case. Based on HP-UX patch PHKL_16239: The SCHED_NOAGE scheduling policy has approximately the same priority range as SCHED_TIMESHARE. However, the priority does not degrade with time or cpu usage. It provides an alternative to real time processes which always run first and have the possibility of taking over the system. Based on HP-UX patch PHKL_16368: The thread library spinlock did not take advantage of the cached lock value. In addition, it performed an unnecessary fetch each time through the 'spin' loop while waiting for the lock to be free. These conditions caused a large amount of unnecessary bus traffic. Enhancement: No (superseded patches contained enhancements) PHCO_21164: Ported HP-UX patch PHCO_19666 to VVOS Based on HP-UX patch PHCO_19666: Libc was unable to use thread callbacks, which are needed for multithreaded performance enhancements. PHKL_18945: Ported HP-UX patch PHKL_17935 to VVOS Based on HP-UX patch PHKL_17935: libpthread enhancement to improve thread spinlock performance and overall system performance by lowering the amount of bus traffic during spinlock contention. SR: 1653294868 1653296962 4701401240 5003360446 5003451591 8606184540 8606232793 8606245135 8606249251 8606338187 8606255251 8606259437 8606294128 8606307008 8606314230 4701398123 8606186056 8606353311 Patch Files: OS-Core.C-MIN-32ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/libpthread.a /usr/lib/libpthread_tr.a OS-Core.C-MIN-64ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/pa20_64/libpthread.a /usr/lib/pa20_64/libpthread_tr.a OS-Core.CORE-64SLIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/pa20_64/libpthread.1 /usr/lib/pa20_64/libpthread_tr.1 OS-Core.CORE-SHLIBS,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/libpthread.1 /usr/lib/libpthread_tr.1 what(1) Output: OS-Core.C-MIN-32ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/libpthread.a: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 18:04 :40 EST 2004 /usr/lib/libpthread_tr.a: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 18:07 :11 EST 2004 OS-Core.C-MIN-64ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/pa20_64/libpthread.a: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 19:20 :55 EST 2004 /usr/lib/pa20_64/libpthread_tr.a: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 19:23 :36 EST 2004 OS-Core.CORE-64SLIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/pa20_64/libpthread.1: Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 19:22 :17 EST 2004 libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) /usr/lib/pa20_64/libpthread_tr.1: Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 19:24 :57 EST 2004 libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) OS-Core.CORE-SHLIBS,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: /usr/lib/libpthread.1: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 18:05 :56 EST 2004 /usr/lib/libpthread_tr.1: libpthread.c $Date: 2003/12/05 21:50:14 $Revision: r 11ros/11 PATCH_11.00 (PHCO_29959) Pthread Interfaces libpthread HP-UX (Release B.11.04): Thu Mar 18 18:08 :29 EST 2004 cksum(1) Output: OS-Core.C-MIN-32ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 463741115 227674 /usr/lib/libpthread.a 3699842692 257394 /usr/lib/libpthread_tr.a OS-Core.C-MIN-64ALIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 316068096 379046 /usr/lib/pa20_64/libpthread.a 4225565985 432252 /usr/lib/pa20_64/libpthread_tr.a OS-Core.CORE-64SLIB,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 4285880284 135800 /usr/lib/pa20_64/libpthread.1 2077418089 165104 /usr/lib/pa20_64/libpthread_tr.1 OS-Core.CORE-SHLIBS,fr=B.11.04,fa=HP-UX_B.11.04_32/64,v=HP: 630051278 143360 /usr/lib/libpthread.1 1519245272 167936 /usr/lib/libpthread_tr.1 Patch Conflicts: None Patch Dependencies: s700: 11.04: PHKL_19142 s800: 11.04: PHKL_19142 Hardware Dependencies: None Other Dependencies: None Supersedes: PHKL_18945 PHCO_21164 PHCO_29761 Equivalent Patches: PHCO_29959: s700: 11.00 s800: 11.00 PHCO_29960: s700: 11.11 s800: 11.11 Patch Package Size: 530 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_30618 5. Run swinstall to install the patch: swinstall -x autoreboot=true -x patch_match_target=true \ -s /tmp/PHCO_30618.depot By default swinstall will archive the original software in /var/adm/sw/save/PHCO_30618. 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_30618.text file is available in the product readme: swlist -l product -a readme -d @ /tmp/PHCO_30618.depot To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHCO_30618.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None