mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-12 14:20:13 +00:00
support: Add check for TID zero in support_wait_for_thread_exit
Some kernel versions (observed with kernel 5.14 and earlier) can list "0" entries in /proc/self/task. This happens when a thread exits while the task list is being constructed. Treat this entry as not present, like the proposed kernel patch does: [PATCH] procfs: Do not list TID 0 in /proc/<pid>/task <https://lore.kernel.org/all/8735pn5dx7.fsf@oldenburg.str.redhat.com/> Fixes commit032d74eaf6
("support: Add support_wait_for_thread_exit"). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com> (cherry picked from commit176c88f521
)
This commit is contained in:
parent
33adeaa3e2
commit
4bf7251998
@ -43,7 +43,10 @@ support_wait_for_thread_exit (void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp (e->d_name, ".") == 0 || strcmp (e->d_name, "..") == 0)
|
||||
/* In some kernels, "0" entries denote a thread that has just
|
||||
exited. */
|
||||
if (strcmp (e->d_name, ".") == 0 || strcmp (e->d_name, "..") == 0
|
||||
|| strcmp (e->d_name, "0") == 0)
|
||||
continue;
|
||||
|
||||
int task_tid = atoi (e->d_name);
|
||||
|
Loading…
Reference in New Issue
Block a user