This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libgo patch committed: Include TLS size in stack size
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, gofrontend-dev at googlegroups dot com
- Date: Tue, 5 Jun 2012 09:20:18 +0200
- Subject: Re: libgo patch committed: Include TLS size in stack size
- References: <mcroboyxou5.fsf@dhcp-172-18-216-180.mtv.corp.google.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Jun 04, 2012 at 11:19:46PM -0700, Ian Lance Taylor wrote:
> This patch to libgo includes the TLS size in the requested stack size of
> a new thread, if possible. This relies on the glibc-specific (and
> undocumented) _dl_get_tls_static_info call. This is particularly
> necessary when using glibc, because glibc removes the static TLS size
> from the requested stack space, and gives an error if there is not
> enough space. That means that a program that has a lot of TLS variables
> will fail bizarrely, or worse may simply get a stack overflow
> segmentation violation at runtime. This patch is far from perfect, but
> at least works around that problem for such programs. Bootstrapped and
> ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline and
> 4.7 branch.
That is a very bad idea. _dl_get_tls_static_info is @@GLIBC_PRIVATE symbol,
therefore it must not be used by anything but glibc itself, may change or
may be removed at any time. Not using of GLIBC_PRIVATE symbols are even enforced
by rpm, so if you build gcc as rpm, it won't install. So especially
committing that to 4.7 branch is fatal.
Talk to libc-alpha@sourceware.org for what should be done instead.
Jakub