-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Swift.assertionFailure
call unexpectedly crashes in -O
/ release build when captured in singleton initializer
#60249
Comments
Changing the initializer from init(assertionFailure: @escaping AssertionFailure = Swift.assertionFailure) {
_assertionFailure = assertionFailure
} to: init(
assertionFailure: @escaping AssertionFailure = { message, file, line in
Swift.assertionFailure(message(), file: file, line: line)
})
{
_assertionFailure = assertionFailure
} fixes the issue, but naively I would expect those two implementations to behave identically. |
Fascinating issue. Would you mind sharing what crash you get? |
The
|
@timoninas That is a problem with Lottie, not Swift itself. Searching the web for this failure or creating an issue in the Lottie repository might be helpful. |
And I have this problem when I call:
In any other case - this error is not present. |
For Lottie-specific problems please file an issue on the airbnb/lottie-ios repo. This issue is specifically about the unexpected release crash of |
Describe the bug
A call to
Swift.assertionFailure
can unexpectedly crash in-O
/ release builds, when captured in a singleton initializer.Steps To Reproduce
Build and run this sample code with
-O
:Expected behavior
Neither calls to
Swift.assertionFailure
should crash, since the code is build with-O
.The first call to
Logger().assertionFailure
doesn't crash, as expected, but the call toLogger.shared.assertionFailure
does crash (despite being initialized with exactly the same arguments).Environment (please fill out the following information)
The text was updated successfully, but these errors were encountered: