-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
libsourcekitdInProc.so crashes on OStream_write #67975
Comments
Tracked in Apple’s issue tracker as rdar://113571225 |
@ahoppen FWIW I think this is an issue with |
I just moved it here because it seems to affect sourcekit-lsp at the moment. We can move it back if we figure out that it’s an issue in the build of A couple questions:
|
I'm using a 5.9 development snapshot from swift.org |
OK, that’s odd. Let’s double-check a few more facts because I’m completely confused:
|
@ahoppen to answer your questions in order:
My gut feeling is that there's something about this setup (very possibly the usage of a resilient library/swiftinterface?) that's causing SourceKitInProc to encounter a codepath where it has to compile SIL, hence the crash. I know resilience isn't supported on Linux targets, but IIUC it should work fine on Linux hosts as long as the target is ABI-stable (indeed, just about everything else does work); this will likely be a precursor to swiftlang/sourcekit-lsp#786. |
OK, (3) clarified everything. I thought it was the other way round, which confused me. In that case your analysis right at the start was correct. I’m moving this issue back to the swift repo. Let me summarize in my own words:
It looks that so far we mostly got lucky and didn’t call the missing symbols most of the time, the presence of a search path with a non-prebuilt module just happens to exercise a code path that does end up calling one of the missing symbols. |
I am hitting the same issue when trying to use Opening any
Running that gives me the following output:
Lastly, I am also getting a lot of:
|
Description
In some configurations, SourceKit on Linux fails to cache modules (while emitting SIL?), crashing with the following error:
The function in question is defined here
https://github.com/apple/swift/blob/b914fc05d881a1d672684b50e98334d5fb203713/lib/Basic/BasicBridging.cpp#L22-L25
And used here
https://github.com/apple/swift/blob/b914fc05d881a1d672684b50e98334d5fb203713/SwiftCompilerSources/Sources/SIL/Function.swift#L266-L286
I was able to confirm that pre-building a module cache with
swiftc
stops the crash from occurring. Runningnm
onlibsourcekitdInProc.so
, it seems like the symbol is unresolved:Interestingly, other libraries (and swiftc) static-link the symbol from libBasic just fine so I'm not sure what's special about sourcekitdInProc.
Steps to reproduce
sourcekit-lsp
with a non-prebuilt module in the search path (such as by passing-Xswiftc -I/path/to/module
)Expected behavior
libsourcekitdInProc.so should not cause a crash.
Environment
Note that I was able to repro this as far back as Swift 5.7.3 (didn't test anything earlier than that).
The text was updated successfully, but these errors were encountered: