guardianproject/android-database-sqlcipher — Issue #17: CursorWindow need to grow crash
Author: PARASOFT
Created: 2011-10-19 08:11:48+00:00
State: open

I am using the libraries that comes with `guardianproject-android-database-sqlcipher-0.0.5-BETA-2-gb9080f7.zip` and my database is created without any problems. My first sql query works fine but 2nd one fails. I get the following error. 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 also 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 with Android's Sqlite.

The 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): #01 pc 00002708 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.651: INFO/DEBUG(2187): #02 pc 00003b34 /data/data/com.MyProject/lib/libdatabase_sqlcipher.so
10-19 10:55:13.651: INFO/DEBUG(2187): #03 pc 000170b4 /system/lib/libdvm.so
10-19 10:55:13.651: INFO/DEBUG(2187): #04 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): #01 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