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

Missing part of crash message #3905

Open
sindresorhus opened this issue Apr 26, 2024 · 2 comments
Open

Missing part of crash message #3905

sindresorhus opened this issue Apr 26, 2024 · 2 comments

Comments

@sindresorhus
Copy link

Platform

macOS

Environment

Production

Installed

Swift Package Manager

Version

8.24.0

Did it work on previous versions?

No response

Steps to Reproduce

Some code crashes in production for violating the Swift Hashable requirement.

Crash report: https://sindresorhus.sentry.io/share/issue/ab8eb435cc71469082a07cdbece72d70/

Expected Result

I expected to see the full error message.

Actual Result

Sentry only shows part of it, making it impossible to track down the issue.

Sentry shows:

' were found in a Dictionary.

While it should have shown:

Duplicate keys of type 'SomeKeyType' were found in a Dictionary.

Kinda looks like some sanitizing going wrong.

Are you willing to submit a PR?

No response

@philipphofmann
Copy link
Member

Thanks for reporting this. I can reproduce the issue by adding the following code to our iOS-Swift sample app and running a release build on an iOS simulator.

var dict = [Something() : "value", Something() : "value"]

for _ in 0..<100 {
    dict[Something()] = "value \(1)"
}

class Something :Hashable {
    
    private var x: Int = 0

    static func == (lhs: Something, rhs: Something) -> Bool {
        return true
    }
    
    func hash(into hasher: inout Hasher) {
        hasher.combine(Int.random(in: 0..<100))
    }
}

@sindresorhus
Copy link
Author

Another example (also Hashable violation):

EKCale > Fatal error >
Stack overflow in (null)

Interestingly, this one doesn't show the were found in a Dictionary. part at all. And EKCale is a cut off EKCalendar.

https://sindresorhus.sentry.io/share/issue/0e4faa9089734b2bbe498a1e876fb30e/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Status: Needs Discussion
Development

No branches or pull requests

3 participants