Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition when loading dictionary shared libraries #12552

Closed
pcanal opened this issue Mar 27, 2023 · 1 comment · Fixed by #12553
Closed

Race condition when loading dictionary shared libraries #12552

pcanal opened this issue Mar 27, 2023 · 1 comment · Fixed by #12553

Comments

@pcanal
Copy link
Member

pcanal commented Mar 27, 2023

As report by @scott-snyder in #11263

Earlier, ATLAS was seeing a nasty race condition involving ROOT dictionary
information (see ATR-25049).

The ROOT internal class TClassTable records information about all classes
that could potentially be created. This is effectively a singleton,
but TClassTable itself does no locking. Rather, it depends on callers
already having acquired the root internal mutex. When a shared library
is loaded that contains dictionary information, TClassTable gets calls
to register information for classes defined in that file. However,
the ROOT lock is not acquired in that case. So a shared library load
could race with TClass::GetClass and result in corruption of TClassTable.

This change modifies TGenericClassInfo::Init so that we will take the lock
when a shared library is loaded.

(ATLAS is currently working around this by hacking shared library loading
in order to acquire the lock, but this hack is not possible with newer
versions of glibc, so this will eventually become a blocker for
moving to centos9.)

See also #11263 (comment)

@pcanal pcanal added the bug label Mar 27, 2023
@pcanal pcanal self-assigned this Mar 27, 2023
@pcanal pcanal added this to the 6.30/00 milestone Mar 27, 2023
pcanal added a commit to pcanal/roottest that referenced this issue Mar 27, 2023
pcanal added a commit to pcanal/roottest that referenced this issue Mar 27, 2023
pcanal added a commit to pcanal/root that referenced this issue Mar 27, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
@scott-snyder
Copy link
Collaborator

Thanks Philippe!

I'm pretty sure we'll want this in 6.28, and maybe in 6.26 as well.

pcanal added a commit to pcanal/roottest that referenced this issue Mar 28, 2023
pcanal added a commit to pcanal/roottest that referenced this issue Apr 3, 2023
pcanal added a commit to pcanal/root that referenced this issue Apr 3, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit to pcanal/root that referenced this issue Apr 3, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit to pcanal/root that referenced this issue Apr 3, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit to pcanal/root that referenced this issue Apr 3, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
@pcanal pcanal modified the milestones: 6.30/00, 6.28/04 Apr 17, 2023
pcanal added a commit that referenced this issue Apr 19, 2023
This fixes #12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit to pcanal/root that referenced this issue Apr 21, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit that referenced this issue Apr 21, 2023
This fixes #12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit to root-project/roottest that referenced this issue Apr 21, 2023
@pcanal pcanal added this to Issues in Fixed in 6.26/12 via automation Apr 21, 2023
@pcanal pcanal added this to Issues in Fixed in 6.30/00 via automation Apr 21, 2023
@pcanal pcanal added this to Issues in Fixed in 6.28/04 via automation Apr 21, 2023
pcanal added a commit to pcanal/root that referenced this issue Apr 21, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
pcanal added a commit that referenced this issue Apr 26, 2023
This fixes #12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
enirolf pushed a commit to enirolf/root that referenced this issue May 26, 2023
This fixes root-project#12552

This commit add a mutex for the TClassTable inner operations.
Several changes were needed to insure that operation that can
either take the ROOT global lock or recursively call TClassTable
are executed outside of the TClassTable critical sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants