svn commit: r318539 - head/lib/libthr/thread

Konstantin Belousov kostikbel at gmail.com
Wed Jul 26 15:23:24 UTC 2017


On Wed, Jul 26, 2017 at 06:09:00PM +0300, Michael Zhilin wrote:
> Hi Eric, Konstantin,
> 
> This commit breaks libthread_db a bit, particular change is:
> -struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
> +static struct pthread_key _thread_keytable[PTHREAD_KEYS_MAX];
> 
> In libthread_db there is check if _thread_keytable is found in symbols of
> debugged process:
> https://svnweb.freebsd.org/base/head/lib/libthread_db/libthr_db.c?revision=241720&view=markup#l148
> 
> LOOKUP_SYM(ph, "_thread_keytable", &ta->thread_keytable_addr);
> 
> If symbol is not found, pt_ta_new returns "TD_NOLIBTHREAD", even if process
> uses libthr.
> It impacts sysutils/pstack port, it doesn't work for multithreaded
> processes anymore.
> 
> Eric, Konstantin,
> Could you please advise what is best way to fix it:
> 
>    - rollback change of "_thread_keytable" (it looks easy)
>    - or remove "_thread_keytable" from libthread_db
> 
> ?

The td_ta_tsd_iter() API implementation for libthr depends on the ability
to lookup the symbol.  I think that the change should be reverted, it is
easiest solution.

Perhaps a comment should be added noting that the symbol is used by
libthread_db so that the mistake is not repeated.


More information about the svn-src-head mailing list