-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Distributed] fix distributed thunk method descriptor mangling in IRGen #81805
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please smoke test |
06cfe1c
to
132ef47
Compare
@swift-ci please smoke test |
@swift-ci please test macOS |
@swift-ci please smoke test Linux |
@swift-ci please smoke test Windows |
unrelated test failures, docc etc |
@swift-ci please test Windows |
5c42e56
to
bb70c1c
Compare
@swift-ci please smoke test |
bb70c1c
to
a1b7242
Compare
@swift-ci please smoke test |
Unrelated lldb test failure: |
@swift-ci please smoke test macOS |
a1b7242
to
fb6453c
Compare
@swift-ci please smoke test |
Cleaned up this PR a bit |
Description: While we mangle distributed thunks correctly in Mangler we did not update IRGenMangler to also handle them. This remained undiscovered until developers needed to use library evolution where these method descriptors are used, and the distributed_thunk descriptors would be mangled the same as the not-thunks, leading to duplicate symbols. This would result in .N suffixes and break the manled names in resilient witness tables.
Finally, this would manifest in runtime not being able to obtain a witness from the resilient witness table when library evolution is enabled, and causing null witnesses and crashes at runtime when attempting to make remote calls in such project.
This corrects the missing mangling part, which then corrects everything else implicitly -- since we no longer have duplicated symbols, and the thunks are uniqued correctly, everything falls into place and works well.
Scope/Impact: Distributed actors adopters which use library evolution. Specifically, attempts to make a remote call on a https://github.com/resolvable protocol would crash without this fix, making https://github.com/resolvable and the "server / client split" approach of distributed actors not usable at all with library evolution.
Risk: Low, the fix is very centralized to distributed thunks and sil witness tables of distributed protocol witnessing actors.
Testing: Added test verifying the emitted witness tables. Confirmed in real project hitting this problem that the solution is correct and resolves the crashes.
Radar: rdar://144568615 rdar://125628060