[SR-12668] libsourcekitdInProc.so may crash during exit
#55112
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Additional Detail from JIRA
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
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.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.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
The text was updated successfully, but these errors were encountered: