Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libpthread



Module Name:    src
Committed By:   hannken
Date:           Sat Jun  8 08:01:49 UTC 2024

Modified Files:
        src/lib/libpthread: pthread.c

Log Message:
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.184 -r1.185 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