# SQLCipher 3.5.9 native crash after application upgrade

**URL:** <https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967>\
**Category:** SQLCipher\
**Created:** [October 6, 2019, 2:21pm UTC](https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967 "2019-10-06T14:21:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![raiym](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/raiym/32/1641_2.png) [@raiym](https://discuss.zetetic.net/u/raiym)\
**Post date:** [October 6, 2019, 2:21pm UTC](https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967/1 "2019-10-06T14:21:17Z")

</div>

We use 3.5.9 in our Android application.  
After application update (without updating SQLCipher itself) we started getting crash.  
It happened only on one device so far and is not reproducible on others. But we are worried to roll out this update without understanding what is happening. (we use standard sql cipher, not enterprise)

Any suggestion how to solve this issue?

```
--------- beginning of crash
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: ******  ******  ******  ******  ******  ******  ******  ******
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: Build fingerprint: 'user/dev-keys'
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: Revision: '0'
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: ABI: 'arm'
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: pid: 7960, tid: 7983, name: f.client.android.production >>> roid.production <<<
2019-10-06 16:27:42.651 7960-7983/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xb5e8ea3a
2019-10-06 16:27:42.664 432-432/? W//system/bin/hwservicemanager: getTransport: Cannot find entry vendor.display.config@1.1::IDisplayConfig/default in either framework or device manifest.
2019-10-06 16:27:42.667 7960-7983/? A/DEBUG: r0 00000098 r1 00000000 r2 00000ea3 r3 ea3121d0
2019-10-06 16:27:42.667 7960-7983/? A/DEBUG: r4 ea311fde r5 ec0dae08 r6 b5e8ea31 r7 da7f2710
2019-10-06 16:27:42.667 7960-7983/? A/DEBUG: r8 ea312328 r9 00000001 sl ea312038 fp ea3199c8
2019-10-06 16:27:42.667 7960-7983/? A/DEBUG: ip 00000000 sp da7f25c0 lr da2a6747 pc da2ad786 cpsr a00f0030
2019-10-06 16:27:42.771 432-432/? I/chatty: uid=1000(system) hwservicemanage identical 6 lines
2019-10-06 16:27:42.789 432-432/? W//system/bin/hwservicemanager: getTransport: Cannot find entry vendor.display.config@1.1::IDisplayConfig/default in either framework or device manifest.
2019-10-06 16:27:42.802 7960-7993/? D/vndksupport: Loading /vendor/lib/egl/libGLESv2_adreno.so from current namespace instead of sphal namespace.
2019-10-06 16:27:42.807 432-432/? W//system/bin/hwservicemanager: getTransport: Cannot find entry vendor.display.config@1.1::IDisplayConfig/default in either framework or device manifest.
2019-10-06 16:27:42.812 7960-7993/? D/libEGL: loaded /vendor/lib/egl/libGLESv2_adreno.so
2019-10-06 16:27:42.816 7960-7983/? A/DEBUG: backtrace:
2019-10-06 16:27:42.816 7960-7983/? A/DEBUG: #00 pc 000a2786 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #01 pc 0008a2a5 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #02 pc 000837df /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #03 pc 0005f357 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #04 pc 00082a27 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #05 pc 0005ea47 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #06 pc 000553a9 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so (sqlite3_exec+144)
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #07 pc 000da1c1 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #08 pc 00062701 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.817 7960-7983/? A/DEBUG: #09 pc 00081ee9 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #10 pc 0005d35b /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #11 pc 00098a7b /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #12 pc 00095333 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #13 pc 000986b1 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #14 pc 000891f1 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #15 pc 000837df /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.818 7960-7983/? A/DEBUG: #16 pc 0005f357 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #17 pc 00082a27 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #18 pc 0005ea47 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #19 pc 0005eba7 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #20 pc 0005ec5d /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so (sqlite3_prepare16_v2+16)
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #21 pc 000da395 /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/lib/arm/libsqlcipher.so (sqlcipher::compile(_JNIEnv*, _jobject*, sqlite3*, _jstring*)+120)
2019-10-06 16:27:42.819 7960-7983/? A/DEBUG: #22 pc 00da317d /data/app/f.client.android.production-pGW3XjCSzWZigUMFzESkSg==/oat/arm/base.odex (offset 0x6a4000)
2019-10-06 16:27:42.825 432-432/? W//system/bin/hwservicemanager: getTransport: Cannot find entry vendor.display.config@1.1::IDisplayConfig/default in either framework or device manifest.
```

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [October 7, 2019, 1:21pm UTC](https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967/2 "2019-10-07T13:21:10Z")

</div>

Hi @raiym

Unfortunately, it is difficult to troubleshoot without additional information regarding the crash. For example, the following information would be helpful to better understand your situation:

- What Android device presented the crash?
- What is the Android OS version on that device?
- What code was executing with regard to the database library just prior to the crash?
- Were you performing a schema migration?
- Did the database file exist on this device prior to the execution that caused the crash?

That said, the 3.5.9 release is almost 2 years old. It might be worth evaluating whether to update the SQLCipher library for your application. The update includes a major version change, so reviewing the upgrade documentation below is important:

> [@Upgrading to SQLCipher 4](https://discuss.zetetic.net/t/upgrading-to-sqlcipher-4/3283):
>
> The recent release of [SQLCipher 4](https://www.zetetic.net/blog/2018/11/30/sqlcipher-400-release/) introduces many new performance and security enhancements for applications that use SQLCipher for secure local data storage. However, the introduction of new default algorithms, increased KDF iterations and a larger page size means that SQLCipher 4 will not open older databases by default. This document provides guidance on the upgrade options available to applications that have previously integrated SQLCipher versions 1 through 3. Option 1: Database File Migr…

---

<div class="post-metadata">

**Author:** ![raiym](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/raiym/32/1641_2.png) [@raiym](https://discuss.zetetic.net/u/raiym)\
**Post date:** [October 9, 2019, 5:47am UTC](https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967/3 "2019-10-09T05:47:53Z")

</div>

Hello @developernotes. Thank you for taking time to reply.

- It is custom Android device.
- Android 8.1
- Opening database
- No (same everything except the code fixes)
- Yes, several of them.

I understand that it is hard to troubleshoot and if there is no known way (or suggestions) I don’t think that we can find root cause easily. And that version is old as well.

Yes, last time we tried to upgrade to 4.0 version we observed substantial performance decrease and decided to rollback to previous version, so we keep 3.5.9 for now.

---

<div class="post-metadata">

**Author:** ![developernotes](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/developernotes/32/1309_2.png) [@developernotes](https://discuss.zetetic.net/u/developernotes)\
**Post date:** [October 10, 2019, 2:39pm UTC](https://discuss.zetetic.net/t/sqlcipher-3-5-9-native-crash-after-application-upgrade/3967/4 "2019-10-10T14:39:52Z")

</div>

Hi @raiym

> [@raiym](#):
>
> It is custom Android device.

Can you provide some additional information regarding this? Does the device pass the AOSP CTS?

> [@raiym](#):
>
> No (same everything except the code fixes)

Code fixes around the usage of SQLCipher for Android? What other changes occurred on the device? Are you able to consistently reproduce the crash behavior on that one device? If so, are you able to roll back to the previous version of the application to see if the crash still occurs?
