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-10471] LLDB RPC Server crash when trying to print generic type variable #4439
Comments
cc @dcci |
(lldb) r
Process 54319 launched: '/Users/local/swift/build/Ninja-ReleaseAssert+stdlib-Release/swift-macosx-x86_64/bin/pat' (x86_64)
Process 54319 stopped
* thread #​1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #​0: 0x0000000100000d90 pat`cast<T>(value=2 key/value pairs) at pat.swift:3:12
1 func cast<T>(_ value: Any) -> T {
2 let type = T.self
-> 3 return value as! T
4 }
5
6 let dict: [String: Any] = ["a": 1, "b": 2]
7 let casted: [String: Int] = cast(dict)
Target 0: (pat) stopped.
(lldb) frame var type
(@thick [String : Int].Type) type = [String : Int]
(lldb) p type
(@thick [String : Int].Type) $R0 = [String : Int] |
@NSExceptional thanks for your report. Can you please try with the latest snapshot and see if you can reproduce? (I can't, see the comment above). |
My swift/lldb/clang version for reference % ../../lldb-macosx-x86_64/bin/lldb --version
lldb version 7.0.0 (https://github.com/apple/swift-lldb.git revision 5d22087eec8eb6b35ae3ca3f909701820be110b0)
Swift version 5.0-dev (LLVM 079934c3f6, Swift 904ba9bafe) |
I've been unable to test it in my
I tried to follow these instructions to allow changing it to
|
The compiler version and the language version aren't the same thing; the important thing is that all targets need to use the same compiler. The arclite error is something we're figuring out elsewhere, but you can work around it for now by setting your deployment target to 10.11 or newer for all targets. |
Gotcha, thanks for clarifying that for me; it's a distinction I often forget even exists. @dcci, I was just able to test this and it is indeed fixed. Thank you all! |
Attachment: Download
Environment
Xcode 10.2 (10E125)
Swift 5
macOS Mojave 10.14.4 (18E226)
Additional Detail from JIRA
md5: bca43475329f6fd1e57f82755a1c9ebc
Issue Description:
I have attached the original project, and both of my attempts at reducing the crash case. Each project contains a unit tests target with a breakpoint just below the offending line. Print
type
in lldb to see the crash or error.The original project (
Runtime
) crashes when trying to print thelet type = T.self
variable. The first (BetterJSONDecoder
) attempt at a reduction merely prints the error below, as does the second (LLDB-Generic-T.self-Crash
) attempt:I recall both of the reductions also crashing lldb at one point, and then beginning to merely print that error, but that might be a mistake on my part.
My final reduction, which prints the above error, is so short that I can just paste it here:
Any of my attempts at reducing the crash to a more trivial case has managed to avoid the crash somehow. I haven't done this sort of thing a lot, any advice on reducing it further?
The text was updated successfully, but these errors were encountered: