Closed
Description
Linking with certain external libraries can inflate the required amount of thread local storage to astronomical proportions. When the Rust runtime tries to create its threads, it requests a stack size independent of the TLS size, which can lead to pthread_create() failing with EINVAL when the stack size is smaller than the TLS size. This was apparently an issue for the Go runtime as well (http://sourceware.org/ml/libc-alpha/2012-06/msg00175.html).
A potential workaround is to add __static_tls_size (+ possibly a guard page) to the requested stack size, but it's arguably a bug in glibc that TLS comes out of the requested stack, instead of being added to it. This solution is also admittedly not very pleasing...