This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] nptl: Implement pthread_self in libc.so
On 20/12/2017 06:13, Carlos O'Donell wrote:
>
> This version looks good to me.
>
> Would we consider this a fix for an externally visible bug?
> Namely that a user could call pthread_self() in a program not
> linked to libpthread, and get back a 0 value which can't be
> used in subsequent POSIX thread functions without crashing?
AFAIK the pthread_* functions exported by libc.so that accept pthread_t
already handle NULL input in a somewhat consistent wat (pthread_setschedparam,
pthread_getschedparam, and pthread_equal) and it should route to libpthread
if or when the program dlopen it. It essentially a noop operations, but
I think it is the expected behaviour in such cases.