Crash fix in case of forks: use static TLS for alloc tracking storage#490
Draft
Crash fix in case of forks: use static TLS for alloc tracking storage#490
Conversation
initial-exec __thread and placement new. - Add `initialized` field to TrackerThreadLocalState - Shared C header (tls_state_storage.h) for size/alignment constants between loader.c and C++ code, with static_assert - Clean up dead code: _key_once, _tl_state_key, delete_tl_state - Add standalone fork test validating TLS zero-init, fork inheritance, and fresh-thread behavior
67204b8 to
7fd9a0d
Compare
Benchmark results for collatzParameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. See unchanged results
|
Benchmark results for BadBoggleSolver_runParameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics. See unchanged results
|
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.
What does this PR do?
Replacement of PR #483 to remove pthread APIs to manage TLS.
This is an idea from @nsavoire in following PR
Motivation
A user reported a crash in case of forks.
Although we do not understand the sequence that lead to calling init inside the child, with this PR we remove the risk as the storage will always be available through static TLS
Additional Notes
NA
How to test the change?
The PR includes a test for forks.
I did not use gtest as it was not safe with forks.