inaturalist / iNaturalistAndroid

Android app for iNaturalist.org
https://market.android.com/details?id=org.inaturalist.android
MIT License
165 stars 57 forks source link

CursorWindowAllocationException in INaturalistService.getTotalProgressForObservation #1186

Open kueda opened 2 years ago

kueda commented 2 years ago

https://console.firebase.google.com/u/1/project/inaturalist-ios/crashlytics/app/android:org.inaturalist.android/issues/8c870eff67bb6a282d1960a9a8f44810

Fatal Exception: android.database.CursorWindowAllocationException: Could not allocate CursorWindow '/data/user/0/org.inaturalist.android/databases/inaturalist.db' of size 4194304 due to error -12.
       at android.database.CursorWindow.nativeCreate(CursorWindow.java)
       at android.database.CursorWindow.<init>(CursorWindow.java:145)
       at android.database.sqlite.SQLiteCursor.clearOrCreateWindow(SQLiteCursor.java:319)
       at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:159)
       at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:152)
       at android.content.ContentResolver.query(ContentResolver.java:970)
       at android.content.ContentResolver.query(ContentResolver.java:887)
       at android.content.ContentResolver.query(ContentResolver.java:843)
       at org.inaturalist.android.INaturalistService.getTotalProgressForObservation(INaturalistService.java:2483)
       at org.inaturalist.android.INaturalistService.syncObservations(INaturalistService.java:2333)
       at org.inaturalist.android.INaturalistService.onHandleIntentWorker(INaturalistService.java:2036)
       at org.inaturalist.android.INaturalistService$1.run(INaturalistService.java:680)
       at java.lang.Thread.run(Thread.java:919)
budowski commented 2 years ago

Looked into this - unfortunately, we need logs right prior to this type of crash - because it's a DB Cursor leakage, which happens somewhere else in the app - and this stack trace is only the symptom, but not the source of the leak.