-
Notifications
You must be signed in to change notification settings - Fork 194
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
Instantiating Amplitude within a Widget extension leads to crashes #352
Comments
Hello @jaltreuter , Sorry for the late reply. We've been working on this for the past month as part of a whole architecture redesign of the iOS SDK. We've been looking into this issue as well. I get the general idea, and also let me if you've found the steps to reproduce. Dante |
@dantetam has there been any progress on this? I'd love to be able to log analytics from our app extensions. |
Hey @jaltreuter , thanks for the follow up. Do yo have steps to reproduce the issue? I |
@dnshi I don't. The documentation I mentioned in my original post seems to indicate all it takes is to have a SQLite job running when the process is suspended. Before I removed the Amplitude library from all but my app target, this was the most common crash found by Xcode by far. So I don't expect it'd be terribly difficult to repro, but I haven't tried. If I were to recommend somewhere to start, though, I would say try making a demo app with a widget extension that imports this library, and then have the widget do something that you know will kick off a long running or repeated SQLite job. |
@jaltreuter I am going to create an action item to our engineer team and we will prioritize the task. Thanks. |
Has this been fixed? |
Expected Behavior
Instantiating Amplitude within an extension should ideally allow event logging, but at a minimum it should not result in crashes.
Current Behavior
My app has hundreds of reports of crashes in my widget process, with stack traces that show Amplitude is performing sql work at the time of the crash. The logged error is SIGKILL with code 0xdead10cc, which the documentation states means "The operating system terminated the app because it held on to a file lock or SQLite database lock during suspension." In this apple developer thread it's suggested that apps will crash if they're doing sql work when the process is suspended - actually the developer who posted their crash in that thread was also crashing because of Amplitude.
Possible Solution
Not sure. Limit or eliminate long-lived tasks when running in a widget extension, either by detecting it manually or making it a property that can be set by developers?
For now my solution will be to not instantiate Amplitude in my widget extension.
Steps to Reproduce
I haven't been able to reproduce this error on my own.
Environment
Example crash report
The text was updated successfully, but these errors were encountered: