-
Notifications
You must be signed in to change notification settings - Fork 87
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
flagStore.updateStore(updatedFlag: featureFlag) - EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 #381
Comments
Thank you for reporting this and providing context for the usage. We will take a look in the next day or so and let you know if we find anything. |
@Reedyuk, just to confirm, is that stack trace from a crash that occurred on version 9.6.0? The line number you linked to is the head of our v9 development branch and is different on 9.6.0. Have you used any other versions of the LaunchDarkly Client SDK and seen this crash? What percentage of user sessions do you see this crash in? Are you able to determine from your crash reporting tooling if this is happening in the foreground, in the background, or during a specific portion of your app's lifecycle? Extra information here can help greatly in tracking down the cause. Thank you! |
Its around 0.30% of our users, but we aim to have 99.80% of our users to be crash free, so its a concern. It looks like its happening during the app being open/foreground (not backgrounded). Nothing seems to standout particularly from the crash. |
To add more info to this, it doesnt seem to be iOS version related and its not device related. We have a good spread from ios 17.x to 16.x with the same crash. |
Could you provide an overview of how your application uses the allFlags member of the LDClient.ios.kt file? Does this get invoked in a coroutine? If so, could you provide the details of the coroutine scope and how that executes in KMM? Could you also share if/when your application invokes close? It isn't explicitly required to call close, it does however give the SDK a signal to send any buffered evaluation events up to our servers. For very short lived applications this can be important for the integrity of event related data. My inclination right now is to understand the threading behavior of the code and to determine if there are any race conditions or shared references. |
The launch darkly wrapper does this for allFlags:
This stacktrace infers the crash is occurring when we perform the 'start' of Launch Darkly, and its the start that is being called from a coroutine. Close is never invoked so we can ignore that. |
Hi again @Reedyuk. I spent several hours today investigating and did not see any likely culprits in the swift code that would not be more widespread and reported by other customers. I also tried creating a KMM project to try stressing out different error cases, but didn't see any issues in my simple application. I'm not sure what coroutine you should be calling start from. From my previous experience with KMM, I recall there being a constraint on iOS where instances can not be shared across threads. That is a path to investigate further, but I don't think we will be very helpful as we aren't KMM experts and we also don't have all your code to examine. If you provide more code snippets and explanation for how your code makes varies calls to the KMM wrapper library you created, that may help us. Another question: What does your application do when there is no network connectivity? I believe the LDClient.start(...) completion will not be invoked in that case, so your |
Its a tricky one and yes unfortunately there is many additional factors when we involve KMM. The way we have things in our app, we actually abstract the direct use of launch darkly and other remote config providers by putting them under a 'Config' module, this module can then support multiple 'Config Providers' e.g. Launch Darkly, firebase etc, but without the consuming code knowing.(This is more for your context). The onready, ensures that when we try to get config values for keys, that we don't do this until launch darkly is 'ready', so in the above abstraction, we immediately ignore launch darkly until it is in a position to fetch. |
**Requirements** - [ ] I have added test coverage for new or changed functionality Adding unit tests for concurrency issues isn't definitive. Issues such as this need to be thought about at design time. - [x] I have followed the repository's [pull request submission guidelines](../blob/v9/CONTRIBUTING.md#submitting-pull-requests) - [x] I have validated my changes against all supported platform versions **Related issues** #381 **Describe the solution you've provided** Simplified instance dictionary modifications during start and added queue/lock protection for instances.
Describe the bug
We are getting 800 users getting a crash - its a small amount of users but enough for investigation.
To reproduce
Unable to reproduce.
Expected behavior
Not to crash
Logs
Refers to line 596 =
ios-client-sdk/LaunchDarkly/LaunchDarkly/LDClient.swift
Line 596 in 2711aa7
Which seems to be around the flagStore.updateStore, maybe flagStore is not being retained?
Library version
9.6.0
XCode and Swift version
Xcode 15.1 swift 5.4
Platform the issue occurs on
iphone
Additional context
We are using the KMM wrapper of the SDK but under the hood this crash is happening within the launch darkly ios sdk.
https://github.com/MyUNiDAYS/launch-darkly-kotlin-sdk
The text was updated successfully, but these errors were encountered: