Android 9: Sqlcipher crash

Issue: SIGSEGV on Android 9. Sqlcipher version is 4.2.0

Devices: Please refer the playconsole screenshot.

Reproduction: We are still trying to get hold of one of the devices to repro it locally.

Crash:
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
/system/lib/libc.so (pthread_mutex_lock+4)
/data/app/com.airwatch.androidagent-hUDXxLZdlcLi3sWQnK0LLQ==/lib/arm/libsqlcipher.so (sqlite3_bind_text16+18)


Not sure how much of a help this stacktrace is (#pc values could help you with narrowing the flow where the crash occured), thought it would be good to report the bug and help zetetic team with next steps.

Hi @rsarma

Thanks for sharing the crash information. A few follow-up questions regarding the crash:

  • Do you have any sense of the code execution within your application that is causing this crash?
  • Do you happen to know what Android OS version the devices reporting the crash are running?

@developernotes Not sure at what point the crash occurs (app startup or a workflow), except that it is during a Sqlcipher query. This only occurs on Android 9 devices.

Hello @developernotes, we experience the same issue. In our case the crash stack varies sometimes - app crashes in sqlite3_reset, sqlite3_bind_text16 or sqlite3_step. But pthread_mutex_lock is always on the top of crash stack.
Sqlcipher version is 4.2.0 . Android 9 in all cases here as well.

This thread is two months old - have you found any solution to this meanwhile?
Thanks!

Hello @grishav, Can you please upgrade to 4.3.0? The new version includes changes to the mutex initialization and locking in the OpenSSL provider used for Android. Please report back to us whether you still observe the problem in 4.3.0.

@grishav Did consuming 4.3.0 resolve the issue for you ?

The version of our application containing the new Sqlcipher version wasn’t released yet, so I don’t know for sure. I never reproduced this error in my test environment with old version as well - I just see a lot of crashes from my users on Google Play. So unfortunately I can’t be sure until we will release our app to production.

Thanks for the quick response. Once you release with the change, do please keep the thread updated.

Hello @rsarma

SQLCipher 4.3.0 is now available publicly. Thanks!