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

Swift 6 Mode breaks the LaunchDarkly SDK #419

Open
choulepoka opened this issue Dec 13, 2024 · 5 comments
Open

Swift 6 Mode breaks the LaunchDarkly SDK #419

choulepoka opened this issue Dec 13, 2024 · 5 comments

Comments

@choulepoka
Copy link

Describe the bug

When enabling Swift 6 and invoking LDClient.identify(context:timeout:completion:), the program will hard crash.

To reproduce

  • Enable Swift 6 on your project using the Swift Language Version build settings
  • Launch the app
  • Invoke any LD Code that takes a completion handler in parameter

Expected behavior

The call succeeds

Logs

image

Library version

9.12.0

XCode and Swift version

Code 16.2, Swift 6, iOS Simulator 18.2

Platform the issue occurs on

iPhone, iPad & Mac Catalyst

Additional context

For the LDClient.start(config:context::startWaitSeconds:completion:), the completion is nillable, so by specifying nil, this call does not crash. But if you add a completion handler, it will hard crash.

@tanderson-ld
Copy link
Contributor

Thank you for reporting this. We will investigate.

@tanderson-ld
Copy link
Contributor

Hi @choulepoka, I have been unable to reproduce this issue. I tried with XCode 16.2, Swift 6, and a simulator running 18.2.
I also tried with various combinations of actors to see if that was involved, but no luck there either. I don't doubt what you're seeing is an issue, just need additional help getting it to happen.

Would you be willing to make a minimal reproducible project? Getting it to happen in our hello-ios-swift may be an option.

@choulepoka
Copy link
Author

choulepoka commented Jan 3, 2025

Hi @tanderson-ld ! Sorry for the delay. I have created a fork of the hello-ios-swift project and adjusted it to reproduce the bug

https://github.com/choulepoka/hello-ios-swift

The issue seems to occurs when I set the minimum iOS version to 15 (up from the project's original iOS 12)

Cheers!

@tanderson-ld
Copy link
Contributor

Thank you for taking the time! When I have a moment I will check that out.

@kcoleman
Copy link

kcoleman commented Jan 21, 2025

@tanderson-ld Hello, I am experiencing a crash in this same method, only when running under Swift 6. I have determined it occurs for me only when the config.startOnline is set to the default of true. If I set it to false, it does not crash. When the startOnline value is true, It crashes on line 841 with a EXC_BREAKPOINT. Running on iOS, version 9.12.2. It does not crash when the completion is nil. Also, the initial call I make is to the LDClient class start method that appears on line 821, which then calls the start method on line 829 (which is the method where the actual crash occurs on line 841).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants