Skip to content

CursorWindow need to grow crash #17

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

Closed
PARASOFT-zz opened this issue Oct 19, 2011 · 9 comments
Closed

CursorWindow need to grow crash #17

PARASOFT-zz opened this issue Oct 19, 2011 · 9 comments
Labels
bug A software defect within SQLCipher for Android

Comments

@PARASOFT-zz
Copy link

I am using the libraries that come with SQLCipherForAndroid-SDK-0.0.5-Beta.tar.gz. My database is created successfully. My first sql query works fine but 2nd one("SELECT count(A) FROM B)" fails when I try to use cursor object returned(which is not null). I test on Samsung Galaxy Gio device.

According to error, it seems that memory allocation fails. (I don't understand why this >2MB allocation is needed, since my query returns empty result. Galaxy Gio is a cheap device, so maybe less heap memory allowed per app?)

The code that leads to this crash is cursor.moveToNext(); but also other calls cursor methods cause this crash. A weird thing is that, this crash doesn't happen if I dig into attached jar's source code with eclipse.

My program works fine if I don't use sqlcipher..

I get the following error in logcat:

10-19 10:55:13.483: ERROR/CursorWindow(2770): need to grow: mSize = 2097152, size = 9, freeSpace() = 0, numRows = 1
10-19 10:55:13.591: INFO/DEBUG(2187): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-19 10:55:13.591: INFO/DEBUG(2187): Build fingerprint: 'samsung/GT-S5660/GT-S5660/GT-S5660:2.2.1/FROYO/XXKC7:user/release-keys'
10-19 10:55:13.591: INFO/DEBUG(2187): pid: 2770, tid: 2770 >>> com.MyProject <<<
10-19 10:55:13.591: INFO/DEBUG(2187): signal 11 (SIGSEGV), fault addr 4f16c448
10-19 10:55:13.591: INFO/DEBUG(2187): r0 4f16c448 r1 00000000 r2 00000001 r3 80000000
10-19 10:55:13.591: INFO/DEBUG(2187): r4 00000000 r5 00000000 r6 00000000 r7 00000000
10-19 10:55:13.591: INFO/DEBUG(2187): r8 00000009 r9 00000000 10 00000001 fp 00000064
10-19 10:55:13.591: INFO/DEBUG(2187): ip 00000000 sp beaed430 lr 00000000 pc afd0f460 cpsr 80000010
10-19 10:55:13.591: INFO/DEBUG(2187): d0 0000002a42280000 d1 3ff0000042280000
10-19 10:55:13.591: INFO/DEBUG(2187): d2 bfd3441350baf6de d3 c1493000c1323800
10-19 10:55:13.591: INFO/DEBUG(2187): d4 4900000040dcb000 d5 000000000006e580
10-19 10:55:13.601: INFO/DEBUG(2187): d6 4515a00000000800 d7 40800000c48ee000
10-19 10:55:13.601: INFO/DEBUG(2187): d8 0000000000000000 d9 0000000000000000
10-19 10:55:13.601: INFO/DEBUG(2187): d10 0000000000000000 d11 0000000000000000
10-19 10:55:13.601: INFO/DEBUG(2187): d12 0000000000000000 d13 0000000000000000
10-19 10:55:13.601: INFO/DEBUG(2187): d14 0000000000000000 d15 0000000000000000
10-19 10:55:13.601: INFO/DEBUG(2187): scr 80000012
10-19 10:55:13.651: INFO/DEBUG(2187): #00 pc 0000f460 /system/lib/libc.so
10-19 10:55:13.651: INFO/DEBUG(2187): #1 pc 00002708 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.651: INFO/DEBUG(2187): #2 pc 00003b34 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.651: INFO/DEBUG(2187): #3 pc 000170b4 /system/lib/libdvm.so
10-19 10:55:13.651: INFO/DEBUG(2187): #4 pc 000039d6 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.651: INFO/DEBUG(2187): code around pc:
10-19 10:55:13.651: INFO/DEBUG(2187): afd0f440 e213301c 0a000008 e1530002 8202301c
10-19 10:55:13.661: INFO/DEBUG(2187): afd0f450 e0422003 e1b03e03 28a04002 28a04002
10-19 10:55:13.661: INFO/DEBUG(2187): afd0f460 48a04002 e1b03103 24801004 e2522020
10-19 10:55:13.661: INFO/DEBUG(2187): afd0f470 e1a03001 4a000002 e2522020 e8a050fa
10-19 10:55:13.661: INFO/DEBUG(2187): afd0f480 2afffffc e2822020 e1b02e02 28a0500a
10-19 10:55:13.661: INFO/DEBUG(2187): code around lr:
10-19 10:55:13.661: INFO/DEBUG(2187): stack:
10-19 10:55:13.661: INFO/DEBUG(2187): beaed3f0 4410eab4
10-19 10:55:13.661: INFO/DEBUG(2187): beaed3f4 44332464 /dev/ashmem/dalvik-LinearAlloc (deleted)
10-19 10:55:13.661: INFO/DEBUG(2187): beaed3f8 00000000
10-19 10:55:13.661: INFO/DEBUG(2187): beaed3fc 898c75f3
10-19 10:55:13.661: INFO/DEBUG(2187): beaed400 afd4172c /system/lib/libc.so
10-19 10:55:13.661: INFO/DEBUG(2187): beaed404 002803d8 [heap]
10-19 10:55:13.661: INFO/DEBUG(2187): beaed408 00000009
10-19 10:55:13.661: INFO/DEBUG(2187): beaed40c 00000000
10-19 10:55:13.661: INFO/DEBUG(2187): beaed410 81505128 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.661: INFO/DEBUG(2187): beaed414 815025f5 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.661: INFO/DEBUG(2187): beaed418 815043c0 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.661: INFO/DEBUG(2187): beaed41c 00200000 [heap]
10-19 10:55:13.661: INFO/DEBUG(2187): beaed420 00000009
10-19 10:55:13.661: INFO/DEBUG(2187): beaed424 00000000
10-19 10:55:13.661: INFO/DEBUG(2187): beaed428 df002777
10-19 10:55:13.661: INFO/DEBUG(2187): beaed42c e3a070ad
10-19 10:55:13.661: INFO/DEBUG(2187): #00 beaed430 4f16c448
10-19 10:55:13.661: INFO/DEBUG(2187): beaed434 002803d8 [heap]
10-19 10:55:13.661: INFO/DEBUG(2187): beaed438 4f16c448
10-19 10:55:13.661: INFO/DEBUG(2187): beaed43c 4eeec008 /dev/ashmem/CursorWindow (deleted)
10-19 10:55:13.661: INFO/DEBUG(2187): beaed440 00280448 [heap]
10-19 10:55:13.671: INFO/DEBUG(2187): beaed444 8150270b /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.671: INFO/DEBUG(2187): #1 beaed448 00000000
10-19 10:55:13.671: INFO/DEBUG(2187): beaed44c 00000000
10-19 10:55:13.671: INFO/DEBUG(2187): beaed450 81506b84 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.671: INFO/DEBUG(2187): beaed454 002803d8 [heap]
10-19 10:55:13.671: INFO/DEBUG(2187): beaed458 00281ac8 [heap]
10-19 10:55:13.671: INFO/DEBUG(2187): beaed45c 81503b39 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so

@PARASOFT-zz
Copy link
Author

I found this, is this a bug in Android? Why do I get this only after I switch to Sqlcipher?:

http://code.google.com/p/android/issues/detail?id=12339

@n8fr8
Copy link
Collaborator

n8fr8 commented Oct 19, 2011

Samsung has some specific differences in their OS libraries, which is causing known, repro'able issues with the current SQLCipher release.

We have a new update in testing that removes the dependencies on the built-in OS libraries, and it has been tested on many Samsung devices.

Stay tuned!

@PARASOFT-zz
Copy link
Author

Hi, I just tested this on HTC Sense and it worked. Seems like a device specific issue.

@n8fr8
Copy link
Collaborator

n8fr8 commented Oct 19, 2011

Yes, Samsung makes a lot of internal changes. Keep going on HTC for now, and we should have the update out soon.

@superfell
Copy link
Contributor

I'm seeing the same crash on a Galaxy S running Froyo (and have previously seen it on a Galaxy S running 2.1 update 1)

E/CursorWindow( 4412): need to grow: mSize = 2097152, size = 18, freeSpace() = 0, numRows = 1
I/DEBUG ( 2383): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 2383): Build fingerprint: 'Samsung/SGH-T959/SGH-T959/SGH-T959:2.2/FROYO/UVKB5:user/release-keys'
I/DEBUG ( 2383): pid: 4412, tid: 4412 >>> com.salesforce.crm <<<
I/DEBUG ( 2383): signal 11 (SIGSEGV), fault addr 4c4c9678
I/DEBUG ( 2383): r0 4c4c9678 r1 00000000 r2 0000000a r3 80000000
I/DEBUG ( 2383): r4 00000000 r5 00000000 r6 00000000 r7 00000000
I/DEBUG ( 2383): r8 00000012 r9 00000000 10 00000002 fp 00000064
I/DEBUG ( 2383): ip 00000000 sp be883450 lr 00000000 pc afd0f5b0 cpsr 80000010
I/DEBUG ( 2383): d0 643a64696f72646e d1 6472656767756265
I/DEBUG ( 2383): d2 50634f544a59493d d3 3067787442617520
I/DEBUG ( 2383): d4 3856733378377836 d5 5443643250766c33
I/DEBUG ( 2383): d6 6772314752507550 d7 544d49336e51745a
I/DEBUG ( 2383): d8 0000000640000000 d9 468000000000004e
I/DEBUG ( 2383): d10 0000000042a00000 d11 0000000000000000
I/DEBUG ( 2383): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 2383): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 2383): d16 0000000047c4c3d8 d17 402c000000000000
I/DEBUG ( 2383): d18 0000000000000000 d19 0000000000000000
I/DEBUG ( 2383): d20 3ff0000000000000 d21 8000000000000000
I/DEBUG ( 2383): d22 0000000000000000 d23 0000000000000000
I/DEBUG ( 2383): d24 0000000000000000 d25 406a000000000000
I/DEBUG ( 2383): d26 4030000000000000 d27 3ff0000000000000
I/DEBUG ( 2383): d28 0000000b0020001c d29 3ff0000000000000
I/DEBUG ( 2383): d30 0000000000000000 d31 3ff0000000000000
I/DEBUG ( 2383): scr 80000012
I/DEBUG ( 2383):
I/DEBUG ( 2383): #00 pc 0000f5b0 /system/lib/libc.so
I/DEBUG ( 2383): #1 pc 00002708 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): #2 pc 00003b34 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): #3 pc 00016e34 /system/lib/libdvm.so
I/DEBUG ( 2383):
I/DEBUG ( 2383): code around pc:
I/DEBUG ( 2383): afd0f590 e213301c 0a000008 e1530002 8202301c
I/DEBUG ( 2383): afd0f5a0 e0422003 e1b03e03 28a04002 28a04002
I/DEBUG ( 2383): afd0f5b0 48a04002 e1b03103 24801004 e2522020
I/DEBUG ( 2383): afd0f5c0 e1a03001 4a000002 e2522020 e8a050fa
I/DEBUG ( 2383): afd0f5d0 2afffffc e2822020 e1b02e02 28a0500a
I/DEBUG ( 2383):
I/DEBUG ( 2383): code around lr:
I/DEBUG ( 2383):
I/DEBUG ( 2383): stack:
I/DEBUG ( 2383): be883410 be8834e0 [stack]
I/DEBUG ( 2383): be883414 430cbad8
I/DEBUG ( 2383): be883418 430cbac0
I/DEBUG ( 2383): be88341c 2646a210
I/DEBUG ( 2383): be883420 00000000
I/DEBUG ( 2383): be883424 003135a0 [heap]
I/DEBUG ( 2383): be883428 00000012
I/DEBUG ( 2383): be88342c 00000000
I/DEBUG ( 2383): be883430 81b05128 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): be883434 81b025f5 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): be883438 81b043c0 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): be88343c 00200000 [heap]
I/DEBUG ( 2383): be883440 00000012
I/DEBUG ( 2383): be883444 00000000
I/DEBUG ( 2383): be883448 df002777
I/DEBUG ( 2383): be88344c e3a070ad
I/DEBUG ( 2383): #00 be883450 4c4c9678
I/DEBUG ( 2383): be883454 003135a0 [heap]
I/DEBUG ( 2383): be883458 4c4c9678
I/DEBUG ( 2383): be88345c 4c1a1008 /dev/ashmem/CursorWindow (deleted)
I/DEBUG ( 2383): be883460 00328678 [heap]
I/DEBUG ( 2383): be883464 81b0270b /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): #1 be883468 00000000
I/DEBUG ( 2383): be88346c 00000000
I/DEBUG ( 2383): be883470 81b06b84 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): be883474 003135a0 [heap]
I/DEBUG ( 2383): be883478 0031f9d0 [heap]
I/DEBUG ( 2383): be88347c 81b03b39 /data/data/com.salesforce.crm/lib/libdatabase_sqlcipher.so
I/DEBUG ( 2383): dumpmesg > /data/log/dumpstate_app_native.log

@PARASOFT-zz
Copy link
Author

Hi,
Is this issue fixed with 0.0.6 release?

@developernotes
Copy link
Member

Hi PARASOFT,

We are not seeing this issue in the latest build with our internal test suite. Could you give the latest binaries a try and let us know your results as well? Thanks!

Nick Parker

@PARASOFT-zz
Copy link
Author

Hi Nick,
I tested with 0.0.6-final3 and the issue seems to be fixed.

@developernotes
Copy link
Member

Hi PARASOFT,

Thanks for reporting the update. Could you close the ticket? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A software defect within SQLCipher for Android
Projects
None yet
Development

No branches or pull requests

4 participants