I recently upgraded from Swift 6.0.2 to Swift 6.1.2 in WSL (Ubuntu 22.04 on Windows 11). Now, jump-to-definition and tooltips don't work -- even hovering over something can cause a segfault.
Full crash log
done ***
*** Program crashed: Bad pointer dereference at 0x0000000000000010 ***
Thread 0 "sourcekit-lsp":
0 0x000078ee9c64280a sigsuspend + 74 in libc.so.6
Thread 1:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 2:
0 0x000078ee9c725e2e epoll_wait + 94 in libc.so.6
Thread 3:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 4:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 5:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 6:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 7:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 8:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 9:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 10:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 11:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 12:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 13:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 14:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 15:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 16:
0 0x000078ee9c725e2e epoll_wait + 94 in libc.so.6
Thread 17:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 18:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 19:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 20:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 21:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 22:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 23:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 24:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 25:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 26:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 27:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 28:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 29:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 30:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 31:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 32:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 33:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Thread 34:
0 0x000078ee9c71481c __read + 76 in libc.so.6
1 [ra] [inlined] [system] 0x00005a08b8c9c864 Process.readOutput(onFD:outputClosure:) in sourcekit-lsp at //<compiler-generated>
2 [ra] 0x00005a08b8c9c864 closure #5 in Process.launch() + 147 in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Process/Process.swift:779:47
3 [ra] 0x00005a08b8ca1017 partial apply for closure #5 in Process.launch() + 54 in sourcekit-lsp
4 [ra] [inlined] 0x00005a08b8cb7aad specialized Condition.whileLocked<A>(_:) in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Thread.swift:43:21
5 [ra] [inlined] 0x00005a08b8cb7aad closure #1 in closure #1 in Thread.init(task:) in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Thread.swift:42:46
6 [ra] 0x00005a08b8cb7aad closure #1 in Thread.init(task:) + 108 in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Condition.swift:50:20
Thread 35:
0 0x000078ee9c71481c __read + 76 in libc.so.6
1 [ra] [inlined] [system] 0x00005a08b8c9ccfe Process.readOutput(onFD:outputClosure:) in sourcekit-lsp at //<compiler-generated>
2 [ra] 0x00005a08b8c9ccfe closure #6 in Process.launch() + 157 in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Process/Process.swift:808:51
3 [ra] 0x00005a08b8ca1017 partial apply for closure #5 in Process.launch() + 54 in sourcekit-lsp
4 [ra] 0x00005a08b8cb7af8 closure #1 in Thread.init(task:) + 183 in sourcekit-lsp at /home/build-user/swift-tools-support-core/Sources/TSCBasic/Thread.swift:50:17
Thread 36 crashed:
0 0x000078ee28510e1e swift::PatternBindingDecl::getPatternEntryIndexForVarDecl(swift::VarDecl const*) const + 14 in libsourcekitdInProc.so
Thread 37:
0 0x000078ee9c691117 __futex_abstimed_wait_cancelable64 + 231 in libc.so.6
Registers:
rax 0x0000000000000000 0
rdx 0x000078ede8034a70 00 00 00 00 00 00 00 00 f8 7f 01 e8 ed 78 00 00 ········ø··èíx··
rcx 0x0000000000000000 0
rbx 0x000000000000006f 111
rsi 0x0000000000000000 0
rdi 0x000078ede9331e38 98 fa 3f 2e ee 78 00 00 ff ff ff ff ff ff ff ff ·ú?.îx··ÿÿÿÿÿÿÿÿ
rbp 0x0000000000000000 0
rsp 0x000078ee06ff7520 00 76 ff 06 ee 78 00 00 38 1e 33 e9 ed 78 00 00 ·vÿ·îx··8·3éíx··
r8 0x000000000000002c 44
r9 0x0000000000000000 0
r10 0x0000000000000001 1
r11 0xfffffffffffff000 18446744073709547520
r12 0x0000000000000000 0
r13 0x000078ede8ead450 c8 a2 9e e8 ed 78 00 00 60 f6 3f 2e ee 78 00 00 È¢·èíx··`ö?.îx··
r14 0x000078ede9331e38 98 fa 3f 2e ee 78 00 00 ff ff ff ff ff ff ff ff ·ú?.îx··ÿÿÿÿÿÿÿÿ
r15 0x000078ede9343a8c 72 6f 77 3a 20 43 75 72 73 6f 72 20 3d 20 43 75 row: Cursor = Cu
rip 0x000078ee28510e1e 48 8b 47 10 48 c1 e8 30 45 31 e4 48 83 f8 01 0f H·G·HÁè0E1äH·ø··
rflags 0x0000000000010202
cs 0x0033 fs 0x0000 gs 0x0000
Images (71 omitted):
0x00005a08b7585000–0x00005a08b9a7d960 48eb561cd19fc594789760fca2a6754b0fb7ff74 sourcekit-lsp /home/bbrk24/.local/share/swiftly/toolchains/6.1.2/usr/bin/sourcekit-lsp
0x000078ee26200000–0x000078ee2df1ba48 c3e9ed51e5e7564052447f0847066a2f0befe903 libsourcekitdInProc.so /home/bbrk24/.local/share/swiftly/toolchains/6.1.2/usr/lib/libsourcekitdInProc.so
0x000078ee9c600000–0x000078ee9c7bc341 d5197096f709801829b118af1b7cf6631efa2dcd libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so.6
Backtrace took 14.00s
[Info - 5:25:12 PM] Connection to server got closed. Server will restart.
true
[Error - 5:25:12 PM] Server process exited with signal SIGSEGV.
/home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift:4:12: error: no such module 'SQLite'
import SQLite
^
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. While evaluating request TypeCheckSourceFileRequest(source_file "/home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift")
1. While evaluating request TypeCheckFunctionBodyRequest(SwiftCrossData.(file).QueryWrapper.count()@/home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift:268:21)
2. While type-checking statement at [/home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift:268:51 - line:296:9] RangeText="{
var (whereClause, arguments) = Self.compile(expression: self.expression)
let quotedTableName = SQLite.Expression<Int>(T.getTableName()).description
var queryString = "SELECT COUNT(*) FROM \(quotedTableName) WHERE \(whereClause)"
if let limit {
queryString += " LIMIT ?"
arguments.append(Int64(limit))
}
if let offset {
queryString += " OFFSET ?"
arguments.append(Int64(offset))
}
queryString += ";"
return try await db.connectionWrapper.withConnection {
[queryString, arguments] (conn) in
let query = try conn.prepare(queryString, arguments)
guard try query.step() else {
throw ReadFailedError()
}
return query.row[0]
}
"
3. While type-checking statement at [/home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift:286:13 - line:295:13] RangeText="return try await db.connectionWrapper.withConnection {
[queryString, arguments] (conn) in
let query = try conn.prepare(queryString, arguments)
guard try query.step() else {
throw ReadFailedError()
}
return query.row[0]
"
4. While type-checking-target starting at /home/bbrk24/workspace/swift-cross-data/Sources/SwiftCrossData/Database.swift:286:24
5. While evaluating request SynthesizeAccessorRequest(SQLite.(file).Statement.row@/home/bbrk24/workspace/swift-cross-data/.build/index-build/checkouts/SQLite.swift/Sources/SQLite/Core/Statement.swift:58:21, get)
*** Signal 11: Backtracing from 0x73b54c510e1e...
The VS Code plugin is completely unusable now. Should I downgrade back to 6.0.2, or is there a workaround? Is this a known issue?