-
Notifications
You must be signed in to change notification settings - Fork 849
Fix DbgCtl use-after-free shutdown crash via leaky singleton #12777
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
Merged
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_centos_dbg_ctl_destruction_crash
Jan 6, 2026
Merged
Fix DbgCtl use-after-free shutdown crash via leaky singleton #12777
bneradt
merged 1 commit into
apache:master
from
bneradt:fix_centos_dbg_ctl_destruction_crash
Jan 6, 2026
Conversation
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
943943e to
f85493c
Compare
ddc9716 to
eb15f64
Compare
324ff8a to
34d79a1
Compare
The DbgCtl registry was experiencing use-after-free crashes during program shutdown, particularly visible in CI regression tests. The root cause was the undefined destruction order of static objects in C++. Problem: - DbgCtl objects can be static or thread-local with lifetimes spanning program execution - When one compilation unit's DbgCtl destructs and triggers registry cleanup, other compilation units may still have DbgCtl objects with pointers into that registry - Thread exit order is also unpredictable, causing similar issues when thread-local DbgCtl objects destruct This implements the "leaky singleton" pattern where the registry is: - Created on first use - Never destroyed (destructor is now = default) - Memory (~20KB) reclaimed by OS at process exit Fixes: apache#12776
623ec71 to
2c68360
Compare
serrislew
approved these changes
Jan 6, 2026
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 9, 2026
PR apache#12777 introduced a leaky singleton pattern for DbgCtl to fix use-after-free crashes during shutdown. However, removing the _rm_reference() method entirely broke ABI compatibility with existing plugins that were compiled against the old header, where the destructor called this method. This commit restores _rm_reference() as a no-op stub, allowing old plugins to load successfully while maintaining the leaky singleton behavior.
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 9, 2026
PR apache#12777 introduced a leaky singleton pattern for DbgCtl to fix use-after-free crashes during shutdown. However, removing the _rm_reference() method broke ABI compatibility with existing plugins that were compiled against the old header, where the destructor called this method. This commit restores _rm_reference() as a no-op stub, allowing old plugins to load successfully while maintaining the leaky singleton behavior.
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 12, 2026
PR apache#12777 introduced a leaky singleton pattern for DbgCtl to fix use-after-free crashes during shutdown. However, removing the _rm_reference() method broke ABI compatibility with existing plugins that were compiled against the old header, where the destructor called this method. This commit restores _rm_reference() as a no-op stub, allowing old plugins to load successfully while maintaining the leaky singleton behavior.
bneradt
added a commit
that referenced
this pull request
Jan 13, 2026
PR #12777 introduced a leaky singleton pattern for DbgCtl to fix use-after-free crashes during shutdown. However, removing the _rm_reference() method broke ABI compatibility with existing plugins that were compiled against the old header, where the destructor called this method. This commit restores _rm_reference() as a no-op stub, allowing old plugins to load successfully while maintaining the leaky singleton behavior.
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 23, 2026
…12777) The DbgCtl registry was experiencing use-after-free crashes during program shutdown, particularly visible in CI regression tests. The root cause was the undefined destruction order of static objects in C++. Problem: - DbgCtl objects can be static or thread-local with lifetimes spanning program execution - When one compilation unit's DbgCtl destructs and triggers registry cleanup, other compilation units may still have DbgCtl objects with pointers into that registry - Thread exit order is also unpredictable, causing similar issues when thread-local DbgCtl objects destruct This implements the "leaky singleton" pattern where the registry is: - Created on first use - Never destroyed (destructor is now = default) - Memory (~20KB) reclaimed by OS at process exit Fixes: apache#12776 (cherry picked from commit 11e99cb)
bneradt
added a commit
to bneradt/trafficserver
that referenced
this pull request
Jan 23, 2026
PR apache#12777 introduced a leaky singleton pattern for DbgCtl to fix use-after-free crashes during shutdown. However, removing the _rm_reference() method broke ABI compatibility with existing plugins that were compiled against the old header, where the destructor called this method. This commit restores _rm_reference() as a no-op stub, allowing old plugins to load successfully while maintaining the leaky singleton behavior. (cherry picked from commit f6cf6fa)
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.
The DbgCtl registry was experiencing use-after-free crashes during program shutdown, particularly visible in CI regression tests. The root cause was the undefined destruction order of static objects in C++.
Problem:
This implements the "leaky singleton" pattern where the registry is:
Fixes: #12776