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

[2.0-alpha-1] SQLiteBlobTooBigException Row too big to fit into CursorWindow requiredPos=0, totalRows=1 #1293

Closed
eboudrant opened this issue Apr 23, 2019 · 11 comments · Fixed by #1310
Milestone

Comments

@eboudrant
Copy link

eboudrant commented Apr 23, 2019

Using 2.0-alpha-1, when clicking on a leak notification :

android.database.sqlite.SQLiteBlobTooBigException: Row too big to fit into CursorWindow requiredPos=0, totalRows=1
at android.database.sqlite.SQLiteConnection.nativeExecuteForCursorWindow(Native Method)
at android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:895)
at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)
at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)
at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:149)
at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:137)
at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:220)
at android.database.AbstractCursor.moveToNext(AbstractCursor.java:269)
at leakcanary.internal.activity.db.HeapAnalysisTable.retrieve(HeapAnalysisTable.kt:75)
at leakcanary.internal.activity.screen.HeapAnalysisSuccessScreen.createView(HeapAnalysisSuccessScreen.kt:33)
at leakcanary.internal.navigation.NavigatingActivity.installNavigation(NavigatingActivity.kt:53)
at leakcanary.internal.activity.LeakActivity.onCreate(LeakActivity.kt:27)
at android.app.Activity.performCreate(Activity.java:7144)

Do yo need more informations ?

ps: the app crashed and I was able to open leak canary from the app drawer with some leaks reported.

@pyricau
Copy link
Member

pyricau commented Apr 24, 2019

Congratulations on filing the first LeakCanary 2 bug 😉🙏

This is a bit unexpected, I wonder what could possibly be too big. If would be super helpful if you could share the hprof file of the leak analysis so that I can reproduce. Depending on whether you have granted sdcard permission before the leak or not, it will in a leakcanary directory either be in your app directory or in /sdcard/Downloads

@pyricau
Copy link
Member

pyricau commented Apr 25, 2019

Reproduced using #1305 to import the hprof, thanks!

@pyricau
Copy link
Member

pyricau commented Apr 25, 2019

In the provided hprof, the sized of the serialized HeapAnalysisSuccess is 3559076 bytes (3.4Mib). Clearing the LeakTraceElement.references field brings it down to 18396 bytes.

@pyricau
Copy link
Member

pyricau commented Apr 25, 2019

Based on https://github.com/aosp-mirror/platform_frameworks_base/blob/master/core/res/res/values/config.xml#L1937 it looks like the window page size is 2048Kib ie 2Mib. So if a row is larger than that, the window will be too small.

@pyricau
Copy link
Member

pyricau commented Apr 25, 2019

Worth noting the max size hasn't changed since 2010 (here aosp-mirror/platform_frameworks_base@34ad57f). Since Android P, we can create windows with a custom max size. Doesn't seem reasonable to try to go above the 2Mib limit though, and I wanted to get rid of references anyway.

pyricau added a commit that referenced this issue Apr 25, 2019
* Updated Reachability inspectors to work like labelers and use the heap dump parser directly
* Removed `LeakTraceElement.references` which was used by inspectors and was causing LeakCanary to store really large blobs in the db, causing #1293

Fixes #1293
pyricau added a commit that referenced this issue Apr 25, 2019
* Updated Reachability inspectors to work like labelers and use the heap dump parser directly
* Removed `LeakTraceElement.references` which was used by inspectors and was causing LeakCanary to store really large blobs in the db, causing #1293

Fixes #1293
pyricau added a commit that referenced this issue Apr 25, 2019
* Updated Reachability inspectors to work like labelers and use the heap dump parser directly
* Removed `LeakTraceElement.references` which was used by inspectors and was causing LeakCanary to store really large blobs in the db, causing #1293

Fixes #1293
pyricau added a commit that referenced this issue Apr 25, 2019
* Updated Reachability inspectors to work like labelers and use the heap dump parser directly
* Removed `LeakTraceElement.references` which was used by inspectors and was causing LeakCanary to store really large blobs in the db, causing #1293

Fixes #1293
@pyricau pyricau added this to the 2.0 Next Release milestone Apr 25, 2019
@eboudrant
Copy link
Author

Thx !

@jocelin09
Copy link

I'm getting this same error, this works fine on oreo and below but when I run the app on pie it crashes
, what might be the issue please help.....

@pyricau
Copy link
Member

pyricau commented May 26, 2019

@jocelin09 are you using alpha 1 or alpha 2? This should have been fixed in alpha 2, let me know if not. Can you provide a hprof file that reproduces this?

@jagapathi111
Copy link

I'm getting this same error, this works fine on oreo and below but when I run the app on pie it crashes
, what might be the issue please help.....

same here. works fine on oreo. But crashes on pie.

@pyricau
Copy link
Member

pyricau commented Jul 1, 2019

@jagapathi111 See my reply right above: #1293 (comment)

are you using alpha 1 or alpha 2? This should have been fixed in alpha 2, let me know if not. Can you provide a hprof file that reproduces this?

@avalanchas
Copy link

@pyricau sorry to ping you for such an old topic, but could you tell me what the problem actually was please? I have the same problem in my app and it's really random and honestly quite hard to google. Which of the changes in the commits referenced above actually fixes this issue? If any? Or ist it just a case of consuming less RAM at that moment when the cursor window is opened?

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

Successfully merging a pull request may close this issue.

5 participants