fix(helper): remove our dyld entry by name on teardown#80
Merged
Conversation
Teardown resolved the slice path through the locator and matched the shared DYLD_INSERT_LIBRARIES entry by exact path. A slice moved or deleted between arm and disarm made the locator return nil, so clearInjection skipped the removal and stranded an entry pointing at a missing dylib; a merely relocated slice failed the exact-path match the same way, and both then needed a manual launchctl unsetenv. Match entries by file name, and remove on teardown by the platform's canonical slice name, independent of the locator, so a relocated or absent slice still tears down. composed() now replaces an entry carrying the same file name, so re-arming a moved slice never doubles ours.
0xnirapod
approved these changes
Jun 29, 2026
0xnirapod
left a comment
Member
There was a problem hiding this comment.
Teardown removes our entry by canonical name, independent of the locator; moved-path and bare-name cases covered. CI green.
This was referenced Jun 29, 2026
Merged
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.
Teardown matched the shared
DYLD_INSERT_LIBRARIESentry by exact path and resolved that path through the slice locator. A slice that moved or was deleted between arm and disarm made the locator return nil, soclearInjectionskipped the removal and stranded a stale entry pointing at a missing dylib; a merely relocated slice failed the exact-path match the same way. Both then needed a manuallaunchctl unsetenvto clear.composed()replaces an entry carrying the same file name, so re-arming a moved slice never doubles ours.InjectionEnvunit tests extended with the moved-path and bare-name cases; the existing distinct-basename cases are unchanged. The fullswift testgate across all four packages andfence-check.shpass locally.