-
Notifications
You must be signed in to change notification settings - Fork 88
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
Crash in Analytics.configuration.getter #286
Comments
Hi @haugli, thanks for the report! Can you share your analytics setup code with me (sans write key)? |
Thanks for taking a look! Here's our setup code: func setup() {
let configuration = Configuration(writeKey: Self.writeKey)
.trackApplicationLifecycleEvents(true)
.apiHost(Self.apiHost)
.cdnHost(Self.apiHost)
.errorHandler { error in
Log.segment.error("Segment encountered an error", error: error)
}
let analytics = Segment.Analytics(configuration: configuration)
analytics.group(groupId: Self.groupId)
self.analytics = analytics
} We've also tried putting a lock around any access to |
No problem, thanks for sharing! Did you see this prior to 1.5.x or is it new, do you know? Would be cool to try to isolate when it started so I can comb through the changelogs since neither of us have a repro scenario. |
We've seen this crash since we first integrated Segment (which was using v1.4.7), but it may also have been there in previous releases. In some of the stack traces, I see that
|
Could be related to the issue we're seeing. |
Hi @haugli- thanks for your patience, we're still looking into this. I'll let you know as soon as we have more to share. In the meantime, please let me know if you get any additional information/insight on your end. Thanks, talk soon! |
@haugli we just released a fix for this in the |
Amazing, thank you @alanjcharles! We'll upgrade to the latest version and let you know if there are any issues. |
Hi @alanjcharles, we've released an app update that integrates v1.5.2 and this issue unfortunately still appears to be present (albeit happening somewhat less frequently). Here's an example stack trace:
|
Hi @erichoracek thanks for letting us know- I'll see what I can find. Talk soon! |
Hi @erichoracek - I hope you're well. I have a few followup questions: 1. Are you certain the crash reports you're seeing are from users who have updated to the latest version of your app? It can take quite awhile for your user base to fully update and since you are seeing a slight decrease since implementing the fix I just want to make sure we're accounting for users who might still be on an older version. On that note- are you still seeing a decrease or has it leveled off? 2. Is there anything particularly unique or bespoke about your Analytics implementation that might give us a clue? We haven't seen this reported by anyone else and are having just as hard of a time as you had trying to replicate it at all, let alone consistently. Any additional details about your implementation you can provide might also be helpful. We will likely have more questions based on your responses to these, but I think this is a good place to start to keep things organized. Please just let me know and we can go from there, thanks! |
Thanks for following up @alanjcharles!
Yes, we are only looking at crashes that occur in the most recent version of our app, and due to the changes made in v1.5.2 of the Segment SDK our crash reporting framework (Sentry) has categorized this as a new crash—if it was the same crash as before it would be grouped in with previous crashes. When we look at what versions that this new crash appears in, it is only present in the most recently released version of our app, which I've double-checked contains the commit that updates Segment to v1.5.2.
It has not continued to decrease, it is steady in the new app version.
There is nothing too special, at app launch we create a configuration with a custom API/CDN host, tracking lifecycle events, with a custom user agent, and then instantiate a |
@alanjcharles I took a quick look at the implementation and I see a few areas for investigation from these lines, which are the source of the crash: guard let a = self.analytics else { return }
guard let system: System = a.store.currentState() else { return }
If it's helpful, enabling strict concurrency checking, adding |
Here is another crash we've received a number of occurrences of that appears to be the same root cause (while accessing the
|
Hi @alanjcharles @bsneed , I spent some time looking into this and it appears to be a thread safety issue with the Sovran-Swift library. I've put together a fix for it here segmentio/Sovran-Swift#10 |
hey thanks @erichoracek! I'll take a look today |
Thanks @alanjcharles, we've since deployed that fix and have confirmed that it resolves the crash. |
amazing. @haugli @erichoracek's fix is now available in |
Describe the bug
After integrating the Segment SDK in our iOS app, we've started seeing a number of crashes in an internal access of
Analytics.configuration
. This is currently our app's top crasher, although only a small percentage of users have experienced it.To Reproduce
We haven't found a way to reproduce this crash, as it seems like it happens under specific timing that is hard to replicate.
The crash seems to always occur a few seconds after launching the app, immediately after a successful
/projects/{key}/settings
fetch.Platform:
Stack Traces
There seem to be two common forms of the stack traces for this crash, below is an example of each.
Example 1:
Example 2:
The text was updated successfully, but these errors were encountered: