Repository navigation
Set the static TLS reserve for Geant4 inside the sim executables - #16105
Merged
Merged
Conversation
sawenzel
force-pushed
the
swenzel/static-tls-reexec
branch
from
November 11, 2026 12:11
35d6199 to
711a69e
Compare
This fixes o2-sim on the GRID, where Geant4 cannot be loaded since it uses the initial-exec TLS model, and adds a unit test. - A Geant4 loaded by dlopen needs a glibc static TLS reserve, which the Geant4 environment sets in GLIBC_TUNABLES. - In GRID jobs the variable arrives truncated as glibc.rtld.optional_static_tls, without its value, and is ignored. - o2-sim now sets the reserve at start, so the workers it launches have it. - The executables that load Geant4 check the reserve first in main and, if it is missing or too small, restart themselves once with it set, since glibc reads tunables only at program start. - Other tunables are kept, and a larger reserve set by the user is left as is. https://its.cern.ch/jira/browse/O2-7305 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sawenzel
force-pushed
the
swenzel/static-tls-reexec
branch
from
November 11, 2026 12:16
3ad18c8 to
c5ac3b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is fixing a bug where o2-sim cannot load Geant4 on the GRID since today's daily ("cannot allocate memory in static TLS block").
Geant4 is now built with the initial-exec TLS model and loaded by dlopen, so glibc needs a static TLS reserve, which the Geant4 environment sets in
GLIBC_TUNABLES. In GRID jobs this variable arrives truncated asglibc.rtld.optional_static_tls, without its value, and glibc ignores it.o2-sim now sets the reserve at start, so the workers it launches have it. The executables that load Geant4 also check it first in
mainand, if it is missing or too small, restart themselves once with it set, since glibc reads tunables only at program start.https://its.cern.ch/jira/browse/O2-7305
Assisted by Claude Code.