Also:
libthr: fix the race between pthread_getname_np() and thread exit The exiting thread frees the thread name in exit_thread() without holding the thread lock. This makes it possible for a thread doing pthread_getname_np() to observe the non-null thread->name and try to copy its content, accessing the memory after free. Set the thread->name to NULL under the thread lock. Note that other thread might still set the exiting thread name, until the PS_DEAD state is assigned. Since code should not call free() after _malloc_thread_cleanup(), re-check thread->name in _thr_free().