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-11604] Crash with EXC_BAD_INSTRUCTION on Xcode 11.2 beta & beta 2 with SPM #54011

Open
onevcat opened this issue Oct 13, 2019 · 5 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software regression run-time crash Bug → crash: Swift code crashed during execution swift 5.1

Comments

@onevcat
Copy link
Contributor

onevcat commented Oct 13, 2019

Previous ID SR-11604
Radar rdar://problem/56255388
Original Reporter @onevcat
Type Bug
Additional Detail from JIRA
Votes 5
Component/s
Labels Bug, 5.1Regression, RunTimeCrash
Assignee None
Priority Medium

md5: d36a13569622b21b1974997a6856dfa0

Issue Description:

What

A crash happens in the package code when used as a Swift Package Manager dependency.

This only happens only in Xcode 11.2 beta 1 & beta 2. The same code / project works well in Xcode 11.0 and Xcode 11.1. So I believe it is a regression of either Swift compiler or Swift Package Manager (or build system).

It says EXC_BAD_INSTRUCTION but there is no other clue. I have no idea on the reason.

How

Sample repo:

https://github.com/onevcat/Kingfisher-Crash

It is a SwiftUI project, with Kingfisher imported by Swift Package Manager. The ContentView just uses KFImage to load an image from Internet.

Expected

The image loaded and a cat image shown in the middle of the screen.

Actual

The app crashes inside some initializer code in Kingfisher.

Screenshot of the crash:

https://user-images.githubusercontent.com/1019875/66711980-a9d80d80-edd0-11e9-95c8-5d221d0c548c.png

Notes

The same project and integration way works fine on Xcode 11.0 and Xcode 11.1.

With Xcode 11.2 beta / beta 2, the app crashes not only on iOS 13.2 beta, but also crashes on iOS 13.1. So I guess it is more likely a compiler or build system issue?

There is also a related issue reported by Kingfisher community:

onevcat/Kingfisher#1306

Thanks and I appreciate it if you have a chance to look into it! Let me know if you need more information or have any progress on it.

@swift-ci
Copy link
Contributor

Comment by Kyle Holzinger (JIRA)

Specifically, it looks like this [line of code|https://github.com/onevcat/Kingfisher/blob/master/Sources/Networking/ImageDownloader.swift#L169] is causing this error. I didn't figure out why or which message was causing the error, but hope this helps haha

@belkadan
Copy link
Contributor

The line-of-code link got messed up, can you post it again?

@belkadan
Copy link
Contributor

@swift-ci create

@swift-ci
Copy link
Contributor

Comment by Kyle Holzinger (JIRA)

Ah, that is annoying. Here is the link again, ignoring jira's weird formatting lol:

https://github.com/onevcat/Kingfisher/blob/master/Sources/Networking/ImageDownloader.swift#L169

@onevcat
Copy link
Contributor Author

onevcat commented Nov 1, 2019

Dig it a bit deeper and now I believe this issue is duplicated to a previous one: https://bugs.swift.org/browse/SR-11564

It only happens when installing a package through Swift Package Manager. Installing it as a dynamic framework works fine.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added the crash Bug: A crash, i.e., an abnormal termination of software label Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. crash Bug: A crash, i.e., an abnormal termination of software regression run-time crash Bug → crash: Swift code crashed during execution swift 5.1
Projects
None yet
Development

No branches or pull requests

4 participants