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-10330] 100% reproducible debugger crash #4597

Closed
swift-ci opened this issue Apr 7, 2019 · 3 comments
Closed

[SR-10330] 100% reproducible debugger crash #4597

swift-ci opened this issue Apr 7, 2019 · 3 comments
Assignees
Labels
bug Something isn't working LLDB for Swift

Comments

@swift-ci
Copy link

swift-ci commented Apr 7, 2019

Previous ID SR-10330
Radar None
Original Reporter GarthSnyder (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Mojave 10.14.4 (release)

Xcode 10.2 (release)

Swift 5

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

md5: b36c5f50fa1405e8654d8692000d81ca

Issue Description:

This is reproducible for me on both macOS and iOS (simulator; I haven't tried a real device). I'm using Xcode, so it's possible the fault actually lies there.

Enter this code:

import Foundation

protocol HasResultType {
    associatedtype ResultType
}
 
extension HasResultType {
 
    static func fetch() throws -> [ResultType] {
        print("in fetch")
        return []
    }
    static func callFetch() throws {
        print("in callFetch")
        let results = try fetch() // Warns: results not used
    }    
}

class Entity: HasResultType {
    typealias ResultType = Entity
}

try? Entity.callFetch()
print("all done")

Then set a breakpoint on any line of callFetch() and run under the debugger. Here's the output I get:

in callFetch
Message from debugger: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. Please file a bug and attach the most recent crash log.
in fetch
all done
Program ended with exit code: -1

Don't worry about the original intent of the code; this version is so minified that you won't be able to tell. The remaining elements all seem to be necessary to reproduce the crash. In particular, the functions must be throwing and fetch() must return a value.

Contrary to the error message, no log is left in ~/Library/Logs/DiagnosticReports. In fact, there is no file starting with 'lldb-' anywhere under ~/Library except in ~/Library/Application Support/CrashReporter. That one contains no detail; it just reports that the crash occurred.

@compnerd
Copy link
Collaborator

compnerd commented Apr 8, 2019

CC: @dcci @adrian-prantl

@adrian-prantl
Copy link
Member

I cloned this to rdar://problem/49699757.

@adrian-prantl
Copy link
Member

I can reproduce the crash with Xcode 10.2 and I can't any more with a current Swift-5.1 toolchain.

@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

3 participants