Skip to content

Fix issues around glibc mis-calculating IE TLS sizes when spindle is running - #213

Open
mplegendre wants to merge 2 commits into
llnl:develfrom
mplegendre:bugfix/tls-calc
Open

mplegendre wants to merge 2 commits into
llnl:develfrom
mplegendre:bugfix/tls-calc

Conversation

@mplegendre

Copy link
Copy Markdown
Member

GLIBC has a bug where any LD_AUDITer disables the normal calculation for an application's IE TLS (also called static TLS in this commit). Applications that need more than the default amount of IE TLS will fail with a message about insufficient TLS under spindle. Based on conversations with GLIBC folks, this may not be fixed for a while (or ever).

To work around this, this commit manually calculates the amount of IE TLS needed before each exec() operation, then if more than the default it uses the GLIBC_TUNABLES environment variable to set the IE TLS amount. Spindle does this scalably by:

  • In the client, before an exec, collect the executable, LD_LIBRARY_PATH, LD_PRELOAD, and component of PATH for an exec, the set of which is used to uniquely identify an exec and its runtime environment.
  • Send that info to the server, which does a standard spindle reduction/broadcast operation to perform I/O on a designated server and share results.
  • Using the provided environment, run an equivalent of 'ldd app' (but using direct calls to ld-linux.so) to get the list of libraries loaded at startup.
  • Iterate over the libraries, executable, and spindle runtime to read their TLS requirements from the binaries and calculate the total IE TLS needed.
  • Broadcast results back down through servers and clients.

This PR also adds several libraries (libbigtls.*) to the testsuite's set of library loads. These libraries have enough TLS to overrun the default IE TLS provided by glibc and require the above algorithm to kick in.

mplegendre and others added 2 commits September 16, 2026 16:29
This adds a large library as a dependency to the testsuite, which triggers
the spindle issues around too-large TLS causing application exits.
GLIBC has a bug where IE TLS is allocated at audit library startup rather
than application startup, which happens before application libraries are
identified and loaded. This can leave the app with insufficient IE TLS.
This works around the issue by manually doing the IE TLS calculation at
exec() time, then using the GLIBC_TUNABLES environment variable to set
the TLS size to a sufficient level for the application. The IE TLS calculation
is done on a single node and communicated to clients via the spindle network.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant