Re: PL/Python fails on new NetBSD/PPC 8.0 install

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: PL/Python fails on new NetBSD/PPC 8.0 install
Дата
Msg-id 11405.1572390032@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: PL/Python fails on new NetBSD/PPC 8.0 install  (Thomas Munro <thomas.munro@gmail.com>)
Список pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> ... and that NetBSD also chose the same arbitrary value for their
> threading stub library:
> https://github.com/NetBSD/src/blob/trunk/lib/libc/thread-stub/thread-stub.c#L392
> ... as they are entirely within their rights to do?

I poked around in that repo, and found the non-stub version of
pthread_self:

https://github.com/NetBSD/src/blob/trunk/lib/libpthread/pthread.c#L863

Relevant to this discussion is that it actually redirects to the
stub version if __uselibcstub is still set, and that variable
appears to be cleared by pthread__init,

https://github.com/NetBSD/src/blob/trunk/lib/libpthread/pthread.c#L187

whose header comment is pretty telling:

/*
 * This needs to be started by the library loading code, before main()
 * gets to run, for various things that use the state of the initial thread
 * to work properly (thread-specific data is an application-visible example;
 * spinlock counts for mutexes is an internal example).
 */

I've not found the mechanism by which pthread__init gets called, but
this sure smells like they think it only has to happen before main().

Interestingly, some of the other files in that directory have recent
CVS log entries specifically mentioning bug fixes for cases where
libpthread is dlopen'd.  So it's not like they don't want to support
the case.  I wonder if they just need to fix pthread_self to forcibly
init the library if __uselibcstub is still set.

            regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: PL/Python fails on new NetBSD/PPC 8.0 install
Следующее
От: Andres Freund
Дата:
Сообщение: pg_waldump erroneously outputs newline for FPWs, and another minorbug