OneSignal-Android-SDK icon indicating copy to clipboard operation
OneSignal-Android-SDK copied to clipboard

Background crashes at com.onesignal.outcomes.data.OSOutcomeEventsCache.getAllEventsToSend(OSOutcomeEventsCache.java:131)

Open voxvox opened this issue 4 years ago • 4 comments

Description:

App has started crashing in the background with the following stacktrace:

Fatal Exception: android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. 
       at android.database.CursorWindow.<init>(CursorWindow.java:108)
       at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
       at android.database.sqlite.SQLiteCursor.clearOrCreateWindow(SQLiteCursor.java:309)
       at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:147)
       at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:141)
       at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219)
       at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:258)
       at com.onesignal.outcomes.data.OSOutcomeEventsCache.getAllEventsToSend(OSOutcomeEventsCache.java:131)
       at com.onesignal.outcomes.data.OSOutcomeEventsRepository.getSavedOutcomeEvents(OSOutcomeEventsRepository.java:14)
       at com.onesignal.OSOutcomeEventsController$2.run(OSOutcomeEventsController.java:87)
       at java.lang.Thread.run(Thread.java:764)

Environment

compileSdkVer = 30 targetSdkVer = 30 minSdkVer = 21 oneSignalVer ="4.3.4" classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.6' not using maven

Steps to Reproduce Issue:

Don't know what is triggering the problem, no idea how to reproduce. It does not happen on my development devices and only today have I started getting crash reports from the field. 100% crashes are in the background.

voxvox avatar Aug 30 '21 15:08 voxvox

@voxvox Thanks for reporting the issue. Could let us know the Android versions and device models you are seeing the crash on? Also could you let us know the percentage of users affected by this crash.

jkasten2 avatar Aug 31 '21 18:08 jkasten2

We see this crash across 4 of our different apps.

Devices examples:

Samsung Galaxy S7 Edge

Samsung Galaxy S8+

Xiaomi Redmi Note 9 Pro

Huawei MediaPad T3 7

Samsung Galaxy Note 8.0

Xiaomi Redmi Note 8 Pro

Xiaomi Mi A2 Lite

Huawei Honor 8A

Huawei HONOR 10i

Amlogic XGODY_X96MINI

Nokia 2.3

XGODY_X96MINI

etc.

Android versions are also random (example from one of the apps):

screenshot

The crash is luckily not very frequent, it is like 20 users 30 crashes in last 90 days.

Thanks

voxvox avatar Aug 31 '21 19:08 voxvox

Same crash with log below

Fatal Exception: android.database.sqlite.SQLiteDiskIOException: disk I/O error (code 266 SQLITE_IOERR_READ)
       at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(SQLiteConnection.java)
       at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:1001)
       at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:838)
       at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
       at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:153)
       at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:140)
       at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:231)
       at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:270)
       at com.onesignal.outcomes.data.OSOutcomeEventsCache.getAllEventsToSend(OSOutcomeEventsCache.java:131)
       at com.onesignal.outcomes.data.OSOutcomeEventsRepository.getSavedOutcomeEvents(OSOutcomeEventsRepository.java:14)
       at com.onesignal.OSOutcomeEventsController$2.run(OSOutcomeEventsController.java:87)
       at java.lang.Thread.run(Thread.java:923)

100% on Android 11,100% in background

CharlieZheng avatar Jun 21 '22 06:06 CharlieZheng

Hi @CharlieZheng,

Thank you for reporting this crash with logs. It seems different than the issue reported for CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.

Based on sqlite documents:

(266) SQLITE_IOERR_READ

The SQLITE_IOERR_READ error code is an extended error code for SQLITE_IOERR indicating an I/O error in the VFS layer while trying to read from a file on disk. This error might result from a hardware malfunction or because a filesystem came unmounted while the file was open.

Could you let us know the following information:

  1. You mention they are all on Android 11. Could you also let us know the device models and the percentage of users affected by this crash?
  2. Also, please let us know the version of OneSignal you are using?

nan-li avatar Jun 21 '22 16:06 nan-li

Closing due to inactivity

emawby avatar Nov 10 '22 21:11 emawby