launchdarkly / ios-client-sdk

LaunchDarkly Client-side SDK for iOS (Swift and Obj-C)
https://docs.launchdarkly.com/sdk/client-side/ios
Other
69 stars 84 forks source link

SIGSEGV in static LaunchDarkly.Event.summaryEvent() #199

Closed MichaelWTA closed 4 years ago

MichaelWTA commented 4 years ago

Describe the bug Our crash reporting system, AppDynamics, has reported a crash that traces back to Launch Darkly. This could be a false positive, we're doing some investigation of our own. SIGSEGV in static LaunchDarkly.Event.summaryEvent(flagRequestTracker: LaunchDarkly.FlagRequestTracker, endDate: Foundation.Date) -> LaunchDarkly.Event?

To reproduce Unknown

Expected behavior No crash.

Logs

0   LaunchDarkly    0x0000000101769b40  static LaunchDarkly.Event.summaryEvent(flagRequestTracker: LaunchDarkly.FlagRequestTracker, endDate: Foundation.Date) -> LaunchDarkly.Event?
1   LaunchDarkly    0x0000000101795268  LaunchDarkly.EventReporter.recordSummaryEvent(completion: () -> ()?) -> ()
2   LaunchDarkly    0x000000010179c6d4  LaunchDarkly.LDClient.user.didset : LaunchDarkly.LDUser
3   LaunchDarkly    0x000000010179d564  LaunchDarkly.LDClient.start(config: LaunchDarkly.LDConfig, user: LaunchDarkly.LDUser?, completion: () -> ()?) -> ()

SDK version 4.1.2

Language version, developer tools Swift 5.1

OS/platform iOS 13.2.2

Additional context As I mentioned before, our crash reporting system picked this up and we're just starting our investigation.

bwoskow-ld commented 4 years ago

Hi @MichaelWTA,

With the information provided I'm not exactly sure what's going on, but it seems like the LaunchDarkly SDK is attempting (and failing) to send a summary event upon initializing the SDK. The SDK shouldn't need to send any summary events back to LaunchDarkly upon initializing -- this might be an indication that your app is attempting to check for variations before it is fully initialized.

In SDK version 4.2.0 we released, among other things, a new identify function which allows for a completion closure when initializing the SDK for a particular user. As part of this change, start (in your stacktrace) was updated to call identify instead of setting a new user. I recommend updating your SDK version (as of this writing, the latest is 4.2.1) to see if this fixes your issue.

Beyond that, to look into this issue further, we recommend that you file a support request by emailing support@launchdarkly.com. This issue tracker is intended for SDK bug reports and feature requests, and this issue sounds more like a support request.

Cheers, Ben