iterable-android-sdk icon indicating copy to clipboard operation
iterable-android-sdk copied to clipboard

Rising crash rates in latest versions

Open KirkBushman opened this issue 3 years ago • 9 comments

Hi,

We've had the Iterable SDK for a few months implemented into our app, without any issues, but since a couple of weeks ago (3.3.6 - 3.3.8 but we're not sure...) we've seen a higher crash / ANR rate with this library.

This is a stack trace that we're getting:

main (native): tid=1 systid=13388
#00 pc 0x70b04 libc.so (__ioctl + 12)
#01 pc 0x3f04f libc.so (ioctl + 26)
#02 pc 0x28527 libsqlite.so (unixFileControl + 578)
#03 pc 0x18a2d libsqlite.so (sqlite3PagerCommitPhaseOne + 1412)
#04 pc 0x18cb7 libsqlite.so (sqlite3BtreeCommitPhaseOne + 90)
#05 pc 0x36629 libsqlite.so (sqlite3VdbeHalt + 2852)
#06 pc 0x43161 libsqlite.so (sqlite3VdbeExec + 40640)
#07 pc 0x1a8bb libsqlite.so (sqlite3_step + 218)
#08 pc 0x993a9 libandroid_runtime.so (android::nativeExecuteForChangedRowCount(_JNIEnv*, _jclass*, long long, long long) + 8)
       at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(SQLiteConnection.java)
       at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:890)
       at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:756)
       at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:66)
       at android.database.sqlite.SQLiteDatabase.delete(SQLiteDatabase.java:1729)
       at com.iterable.iterableapi.IterableTaskStorage.deleteAllTasks(IterableTaskStorage.java:295)
       at com.iterable.iterableapi.OfflineRequestProcessor.onLogout(OfflineRequestProcessor.java:73)
       at com.iterable.iterableapi.IterableApiClient.onLogout(IterableApiClient.java:559)
       at com.iterable.iterableapi.IterableApi.onLogOut(IterableApi.java:1062)
       at com.iterable.iterableapi.IterableApi.setUserId(IterableApi.java:387)
       at net.tandem.core_new.analytics.IterableHelperImpl.init(IterableHelperImpl.java:69)
       at net.tandem.TandemApp.onCreate(TandemApp.java:175)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1192)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:7009)
       at android.app.ActivityThread.access$1400(ActivityThread.java:257)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2009)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:268)
       at android.app.ActivityThread.main(ActivityThread.java:7963)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:627)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)

It seems a SQL issue in the JNI interface.

Can you give an insight into what's going on? Do you have a temporary workaround?

Thanks in advance

KirkBushman avatar Nov 04 '21 09:11 KirkBushman

It seems to be happening with devices from multiple vendors (Google, Samsung, Xiaomi, others...) on Android 11 and up

KirkBushman avatar Nov 04 '21 10:11 KirkBushman

@KirkBushman Thank you for reporting this. This seems to be an issue with the new system that stores pending requests while the device is offline. We've disabled this feature via a feature flag for your project, please check within a few days if this is still happening.

vbabenkoru avatar Nov 11 '21 06:11 vbabenkoru

@vbabenkoru Thanks for the prompt response. Looking again at the stacks that we are receiving it doesn't seem to be evident anymore... Let us know for any more updates

KirkBushman avatar Nov 15 '21 08:11 KirkBushman

@KirkBushman Thank you! Could you also open a ticket with Iterable Support? We'd like to learn more about your issue and that'd be the best way to communicate project-specific information.

vbabenkoru avatar Nov 16 '21 18:11 vbabenkoru

@vbabenkoru I had a chain of mail about this with our contacts at Iterable, they highlighted the issue internally. If you still need a ticket for this can you specify what page I can open it from?

Thanks

KirkBushman avatar Nov 17 '21 09:11 KirkBushman

@KirkBushman As we try and understand this issue a bit more in detail, would you mind sharing roughly what percentage of sessions that we’re using this version of the SDK were crashing that you found? Thanks!

Mturner005 avatar Nov 29 '21 19:11 Mturner005

@Mturner005 tough to say looking at the info we got, I can only see a few users from crashlytics, but it must have happened enough times to contribute to the ANR rate going up.

KirkBushman avatar Nov 30 '21 17:11 KirkBushman

we also get this ANR for android 11 & 12 starting from December. Not sure if they are the same. We also use Iterable

main (native): tid=1 systid=22038
#00 pc 0x9fc58 libc.so 
#01 pc 0x1663c libutils.so 
#02 pc 0x16520 libutils.so 
#03 pc 0x152b78 libandroid_runtime.so 
       at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
       at android.os.MessageQueue.next(MessageQueue.java:335)
       at android.os.Looper.loopOnce(Looper.java:186)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8641)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)

giangpham96 avatar Feb 17 '22 17:02 giangpham96

Hi @giangpham96, thank you for sharing the stacktrace. However, until there is a Iterable specific method (com.iterable.iterableapi) calls in stack trace like the one above, it will be hard to tell what exactly caused crash.

Can you elaborate under what condition this crashes occur? Also, which SDK version were you using?

Also, for Android 11 and 12, I would recommend using our latest SDKs 3.4.4 which added compatibilities and fixes for Android 30+ devices

Ayyanchira avatar Mar 25 '22 16:03 Ayyanchira