This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libgo patch committed: Include TLS size in stack size


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]