Skip to content
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

App Crash on SQLite cursor #19

Closed
philippb opened this issue Feb 27, 2015 · 3 comments
Closed

App Crash on SQLite cursor #19

philippb opened this issue Feb 27, 2015 · 3 comments

Comments

@philippb
Copy link

Amplitude version: com.amplitude:android-sdk:1.3

Stack Trace


0   android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed. 
1       at android.database.CursorWindow.<init>(CursorWindow.java:108)
2       at android.database.CursorWindow.<init>(CursorWindow.java:100)
3       at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
4       at android.database.sqlite.SQLiteCursor.clearOrCreateWindow(SQLiteCursor.java:301)
5       at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:139)
6       at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
7       at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197)
8       at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245)
9       at com.amplitude.api.DatabaseHelper.getEvents(Unknown Source)
10      at com.amplitude.api.Amplitude.updateServer(Unknown Source)
11      at com.amplitude.api.Amplitude.updateServer(Unknown Source)
12      at com.amplitude.api.Amplitude.access$100(Unknown Source)
13      at com.amplitude.api.Amplitude$3.run(Unknown Source)
14      at android.os.Handler.handleCallback(Handler.java:733)
15      at android.os.Handler.dispatchMessage(Handler.java:95)
16      at android.os.Looper.loop(Looper.java:157)
17      at android.os.HandlerThread.run(HandlerThread.java:61)

@allanca
Copy link
Contributor

allanca commented Mar 4, 2015

Thanks for reporting this.

I've been investigating the crash and though I've been unable to reproduce, I have a few theories about possible causes.

It looks like it occurred on Android 5.0. Do you have any other information about the conditions at the time of the crash? Device type? When in the application lifecycle?

allanca added a commit that referenced this issue Mar 4, 2015
Synchronize the singleton access method.
Explicitly close prepared statements in finally block.
@allanca allanca mentioned this issue Mar 4, 2015
allanca added a commit that referenced this issue Mar 11, 2015
* master:
  Include debug info in binaries.
  Fix cursor OOM exception. See issue #19.
  Fix synchronization crash. See issue #16.

Conflicts:
	build.xml
@allanca
Copy link
Contributor

allanca commented Mar 19, 2015

Fixed in release 1.4.4 on 3/11.

@allanca allanca closed this as completed Mar 19, 2015
@xiphirx
Copy link

xiphirx commented May 7, 2015

Still exists on v1.6.2,

Device types:
image

Android versions:
image

0   android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed.
1   at android.database.CursorWindow.<init>(CursorWindow.java:109)
2   at android.database.CursorWindow.<init>(CursorWindow.java:100)
3   at android.database.AbstractWindowedCursor.clearOrCreateWindow(AbstractWindowedCursor.java:198)
4   at android.database.sqlite.SQLiteCursor.clearOrCreateWindow(SQLiteCursor.java:301)
5   at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:139)
6   at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:133)
7   at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:197)
8   at android.database.AbstractCursor.moveToNext(AbstractCursor.java:245)
9   at com.amplitude.api.DatabaseHelper.getEvents(DatabaseHelper.java:91)
10  at com.amplitude.api.AmplitudeClient.updateServer(AmplitudeClient.java:594)
11  at com.amplitude.api.AmplitudeClient.updateServer(AmplitudeClient.java:582)
12  at com.amplitude.api.AmplitudeClient.access$1400(AmplitudeClient.java:31)
13  at com.amplitude.api.AmplitudeClient$4.run(AmplitudeClient.java:343)
14  at android.os.Handler.handleCallback(Handler.java:733)
15  at android.os.Handler.dispatchMessage(Handler.java:95)
16  at android.os.Looper.loop(Looper.java:136)
17  at android.os.HandlerThread.run(HandlerThread.java:61)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants