[Android N] Cursor#copyStringToBuffer crashes with SQLCipher 3.5.1

Cursor#copyStringToBuffer crashes with SQLCipher 3.5.1 with the following exception. Let me know if you would like me to submit a unit test for this.

08-11 17:21:37.957 10904 11082 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10000d in tid 11082 (AsyncTask #1)
08-11 17:21:37.958 377 377 W : debuggerd: handling request: pid=10904 uid=10197 gid=10197 tid=11082
08-11 17:21:38.030 11610 11610 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-11 17:21:38.030 11610 11610 F DEBUG : Build fingerprint: 'google/angler/angler:7.0/NPD90G/3051502:user/release-keys’
08-11 17:21:38.030 11610 11610 F DEBUG : Revision: '0’
08-11 17:21:38.030 11610 11610 F DEBUG : ABI: 'arm’
08-11 17:21:38.031 11610 11610 F DEBUG : pid: 10904, tid: 11082, name: AsyncTask #1 >>> net.zetetic <<<
08-11 17:21:38.031 11610 11610 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10000d
08-11 17:21:38.031 11610 11610 F DEBUG : r0 cbac5100 r1 0010000d r2 0000000a r3 e85b02ac
08-11 17:21:38.031 11610 11610 F DEBUG : r4 00000000 r5 00200005 r6 00000080 r7 cbac5100
08-11 17:21:38.031 11610 11610 F DEBUG : r8 00000005 r9 0010000d sl cb7833d8 fp dd4cafd0
08-11 17:21:38.031 11610 11610 F DEBUG : ip 40000000 sp cbdfde28 lr cbc4df25 pc e884a4e4 cpsr 200d0010
08-11 17:21:38.035 11610 11610 F DEBUG :
08-11 17:21:38.035 11610 11610 F DEBUG : backtrace:
08-11 17:21:38.035 11610 11610 F DEBUG : #00 pc 000174e4 /system/lib/libc.so (memcpy+172)
08-11 17:21:38.035 11610 11610 F DEBUG : #01 pc 00093f21 /data/app/net.zetetic-1/lib/arm/libsqlcipher.so
08-11 17:21:38.035 11610 11610 F DEBUG : #02 pc 00041255 /data/app/net.zetetic-1/oat/arm/base.odex (offset 0x41000)
08-11 17:21:38.896 4791 11627 W ActivityManager: Force finishing activity net.zetetic/.TestSuiteActivity

Hi @karishmab

The current version of SQLCipher for Android is 3.5.3; we would welcome a test case for the crasher you are seeing. Thanks!

Hi Nick,

Confirmed that I’m seeing the same issue with 3.5.3 as well. How can I submit the new test ? I don’t have permissions to upload attachments or push my branch up.

Thanks,
Karishma

Hi @karishmab

You can fork the SQLCipher for Android test suite, define a new test, add it to the runner, finally executing it on either a device or emulator. Once you are able to reproduce it you can send us a pull request. Thanks!

Pull request is on its way. Thanks!