Skip to content
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

[SR-12668] libsourcekitdInProc.so may crash during exit #55112

Open
benlangmuir opened this issue Apr 24, 2020 · 1 comment
Open

[SR-12668] libsourcekitdInProc.so may crash during exit #55112

benlangmuir opened this issue Apr 24, 2020 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@benlangmuir
Copy link
Member

Previous ID SR-12668
Radar rdar://problem/62895057
Original Reporter @benlangmuir
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Bug
Assignee None
Priority Medium

md5: 0ac41711015ebf667b9db47daaa9abcf

Issue Description:

The in-process version of sourcekitd, which is notably the one used on Linux, may crash during `exit`, because of background threads running while we are running static destructors. This has been seen in practice, but is generally non-deterministic.

There are broadly three possible approaches

  1. Teach sourcekitd_shutdown to safely tear down every dispatch_queue or thread used by sourcekit before returning. This also ought to make it possible to respawn sourcekitd within a process, which would be nice for testing.

  2. Disable all static destructors, e.g. by building with -fno-c++-static-destructors. The challenge is that we are using the same object files in sourcekitd that are used by the swift compiler, clang compiler, etc. so this would need to be done for all of these products or we would need to have a separate build, which would be expensive.

  3. Provide an out-of-process version of sourcekitd on Linux like we already do on macOS so that we can control how the server process exits.

libsourcekitdInProc is used on

  • Linux

  • Windows?

  • macOS: as a debugging tool only

@beccadax
Copy link
Contributor

beccadax commented May 5, 2020

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants