C++ exceptions: pthread key allocation error for __gthread_key_create

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Dec 6 07:02:49 UTC 2016



On 06/12/16 01:25, Chris Johns wrote:
> On 05/12/2016 18:19, Sebastian Huber wrote:
>> On 05/12/16 07:57, Chris Johns wrote:
>>> Is it the user who needs to account for the gthread key if using C++?
>>
>> Yes, its up to the user to ensure that there are enough POSIX keys
>> available. This is quite a pain.
>
> It is also error prone and silent and this is a real concern because 
> it exposed very real issues if not correctly configured. The libstdc++ 
> is fragile in this regard.
>
>>
>> Why is no TLS value used (instead of the POSIX key)?
>>
>
> I do not know. It is wrapped by our gthread wrapper.

It seems libstdc++ still uses POSIX keys in case it needs a destructor.

>
>> It would be possible to make the pthread_key_t self-contained, however,
>> for the thread-specific value you need some system provided storage
>> (currently the workspace).
>
> I do not know what this means.

The problem is that all storage for POSIX keys is currently system 
provided. Since it uses the workspace, the configuration must account 
for libstdc++ resources.

If we could change it to use only user provided storage, then we 
wouldn't have to deal with the configuration.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the devel mailing list