[v6.0.x] pmix/base: remove the unused evbase field#14182
Merged
Conversation
opal_pmix_base.evbase was write-only: it was initialized to NULL and then set to opal_sync_event_base in the framework's open function, and nothing in the tree ever read it or freed it. Dead as it is, it is exactly the shape of a bug we just had to fix in the tcp btl: a long-lived copy of OPAL's shared event base, squirreled away in a component's global state. opal_event_finalize() frees that base and NULLs opal_sync_event_base, so any such copy is a dangling pointer for the remainder of teardown, and any code that later grows a use of it -- to register an event, or worse, to free it -- inherits a use-after-free or a double free. Remove the field rather than leave the trap sitting there. Signed-off-by: Jeff Squyres <jeff@squyres.com> (cherry picked from commit ba916b4)
hppritcha
approved these changes
Jul 20, 2026
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.
Backport of #14176 to
v6.0.x.opal_pmix_base.evbasewas write-only: initialized to NULL, set toopal_sync_event_basein the framework's open function, and never read or freed by anything in the tree. Remove the field and the assignment.Dead as it is, it is exactly the shape of pointer that produced the teardown bugs being fixed in #14164: a long-lived copy of OPAL's shared event base parked in a component's global state.
opal_event_finalize()frees that base, so any such copy is dangling for the remainder of teardown, and any code that later grows a use of it inherits a use-after-free. Removing the trap is cheaper than auditing it forever.Split out of #14164 (where earlier revisions of this change were reviewed) since it is independent of the event-base lifetime fix there. Compile-validated on macOS (clang, Apple Silicon) and AlmaLinux 10 (gcc 14, arm64) as part of that PR's full
make checkruns.