Skip to content

[6.0][Macros] Ensure reaping executable plugin process #73548

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented May 9, 2024

Cherry-pick #73547 into release/6.0

  • Explanation: Previously the compiler didn't waitpid for plugins. This hasn't been an issue because usually the lifetime of plugin process is the same as the host process (i.e. swift-frontend or SourceKitService). But when the plugin somehow decided to crash, it went zombie and the compiler respawn another process to recover. This patch ensures reaping the existed plugin process, so the system can clear the process
  • Scope: Executable macro plugins.
  • Risk: Low. llvm::sys::Waitdoes wait for the child process, or terminate it. This LoadedExecutablePlugin::PluginProcess::~PluginProcess() is called when the plugin process crashed, or the host process exits.
  • Testing: Passes current test cases. Local testing with PR toolchain. No added test case because simulating the issue is not easy
  • Issue: rdar://126489446
  • Reviewer: Hamish Knight (@hamishknight) Saleem Abdulrasool (@compnerd)

@rintaro rintaro requested a review from a team as a code owner May 9, 2024 20:38
@rintaro
Copy link
Member Author

rintaro commented May 9, 2024

@swift-ci Please test

rdar://126489446
(cherry picked from commit 0a0e665)
@rintaro rintaro force-pushed the 6.0-macros-plugin-waitpid-rdar126489446 branch from ec077c0 to e535249 Compare May 9, 2024 23:29
@rintaro
Copy link
Member Author

rintaro commented May 9, 2024

@swift-ci Please test

@rintaro rintaro merged commit af88d18 into swiftlang:release/6.0 May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants