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-15128] LLDB Crash #4305

Open
swift-ci opened this issue Aug 28, 2021 · 3 comments
Open

[SR-15128] LLDB Crash #4305

swift-ci opened this issue Aug 28, 2021 · 3 comments
Assignees
Labels
bug Something isn't working Compiler LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-15128
Radar rdar://problem/82543261
Original Reporter dalk (JIRA User)
Type Bug
Environment

xcode 12.5.0

Additional Detail from JIRA
Votes 0
Component/s Compiler, LLDB for Swift
Labels Bug
Assignee @adrian-prantl
Priority Medium

md5: 1411048b52a88fb0a49aecc05e14bcc1

Issue Description:

100 % reproducible crash when compiling this piece of code. Please note that if MyClass is a struct, it doesnt crash. Same if we change "if let entry = entry" to "if let anything = entry"

class MyClass {

**let** value: Int



**init**(value: Int)

{ self.value = value }

}

func test() {

**let** cachedImages: ThreadSafeMap\<String, MyClass\> = ThreadSafeMap\<String, MyClass\>(label: "")



**let** entry = cachedImages.get(key: "toto")



**guard** **let** entry = entry **else**

{ return }

}

public class ThreadSafeMap<T: Hashable, U: AnyObject> {

**private** **var** map: \[T: U\] = \[:\]

**private** **let** cacheAccessQueue: DispatchQueue



**public** **init**(label: String)

{ self.cacheAccessQueue = DispatchQueue(label: label, qos: .userInitiated, attributes: .concurrent) }

**public** **func** get(key: T) -\> U? {

    cacheAccessQueue.sync

{ return map[key] }

}

}

@typesanitizer
Copy link

@swift-ci create

@typesanitizer
Copy link

Could you clarify what exactly is crashing? You said "reproducible crash when compiling this piece of code" – but the title says "LLDB crash". Can you attach a stack trace?

@adrian-prantl
Copy link
Member

Yeah, this compiles fine. Can you attach a crash log and/or more instructions?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Compiler LLDB for Swift
Projects
None yet
Development

No branches or pull requests

3 participants