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-10468] lldb crashes when I hit a breakpoint in a method in a generic class #4573

Closed
swift-ci opened this issue Apr 12, 2019 · 5 comments
Closed
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

Previous ID SR-10468
Radar rdar://problem/49926017
Original Reporter justin.garcia (JIRA User)
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 10.2 (10E125)
Swift 5
macOS Mojave 10.14.3 (18D109)

Additional Detail from JIRA
Votes 0
Component/s LLDB for Swift
Labels Bug
Assignee None
Priority Medium

md5: 77d670bc06cfb10b7963cf397ea89825

Issue Description:

Steps to reproduce:

Open the attached reduction in Xcode.

Set a breakpoint on line 29 of GeneralPickerViewController.swift (the print("test") statement).

Build and run.

Tap the "crash test" button.

When you hit the breakpoint, if you have the Variables View open, lldb will crash.

Here is the reduction from the attached project:

import CoreData
import Foundation
import UIKit

protocol PickerItemProvider: class {
    associatedtype PickerType

    func itemAt(_ indexPath: IndexPath) -> PickerType?
}

class FetchedPickerProvider<ProvidedType: NSManagedObject>: PickerItemProvider {
    typealias PickerType = ProvidedType

    func itemAt(_ indexPath: IndexPath) -> ProvidedType? {
        return nil
    }
}

class GeneralPickerViewController<ItemProvider: PickerItemProvider>: UIViewController where ItemProvider.PickerType: Equatable {
    var itemProvider: ItemProvider?

    var selectedItems = [ItemProvider.PickerType]() // <--- If I remove this line, lldb doesn’t crash.

    override func viewDidLoad() {
        super.viewDidLoad()

        print("test") // <--- Set your breakpoint on this line.
    }
}
@belkadan
Copy link

@dcci, jingham@apple.com (JIRA User), is this familiar?

@swift-ci
Copy link
Author

Comment by Jim Ingham (JIRA)

I haven't seen this before, I captured the crash in an Apple Radar as well.

@swift-ci
Copy link
Author

Comment by Jim Ingham (JIRA)

Note, the crash is trying to get a type name for self, and crashes in:

swift::Mangle::ASTMangler::appendAssociatedTypeName(swift::DependentMemberType*)

@swift-ci
Copy link
Author

Comment by Jim Ingham (JIRA)

But this doesn't repro for me with the swift-5.1 branch swiftc & lldb combo.

@dcci
Copy link
Mannequin

dcci mannequin commented Apr 22, 2019

This has been fixed in 5.1 (and master). Please download a nightly toolchain to verify.

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

No branches or pull requests

2 participants