Source-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: [netbsd-10] src/lib/libpthread
Module Name: src
Committed By: martin
Date: Thu Jun 20 18:22:48 UTC 2024
Modified Files:
src/lib/libpthread [netbsd-10]: pthread.c
Log Message:
Pull up following revision(s) (requested by hannken in ticket #711):
lib/libpthread/pthread.c: revision 1.185
Fix resource leak in pthread_create(). Pthread field "pt_lwpctl"
must not be accessed after _lwp_exit() as the kernel may free
it, attach it to another thread and change its "lc_curcpu".
The "pthread__deadqueue" will fill up with pthreads with
an invalid "pt_lwpctl" and allocated stack that never get
reused.
Replace the test "lc_curcpu == LWPCTL_CPU_EXITED" with
test "_lwp_kill(newthread->pt_lid, 0) == -1 && errno == ESRCH"
to make sure this thread has finished its _lwp_exit().
PR lib/57831 "Memory leaks in libpthread/libc"
To generate a diff of this commit:
cvs rdiff -u -r1.181.2.1 -r1.181.2.2 src/lib/libpthread/pthread.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index