Re: What does this error mean: No space available for static Thread Local Storage ?

From: Konstantin Belousov <kostikbel_at_gmail.com>
Date: Sat, 20 Apr 2024 11:57:19 UTC
On Fri, Apr 19, 2024 at 07:30:48PM -0700, Yuri wrote:
> Hi,
> 
> 
> The shared library that is built by the Rust's toolchain for the port
> misc/py-polars fails to be loaded:
> 
> No space available for static Thread Local Storage
> 
> 
> What does this mean, and what might be wrong?

The error mean that the process tries to load a dso (shared library) that
was build with initial-exec TLS model, and there is not enough space in
the initial TLS segment reserved by rtld to accomodate the dso needs.

As a temporary measure, you might try to play with the LD_STATIC_TLS_EXTRA
env variable to specify the desired size.  Default value is 128 bytes.

For gcc and clang, the TLS model is controlled by -ftls-model switch.
No idea how to pass this through rustc.

One possible reason why you get the initial-exec model is when dso code
was compiled in non-pic mode.