SIGSEGV in CBL after "connection timed out" Sync error

CBL C SDK for Android 3.1.1

I’m reporting this issue on behalf of a user of the Couchbase Lite Dart SDK. Please see this GitHub issue, where the problem was originally reported: SIGSEGV in CBL after "connection timed out" Sync error · Issue #529 · cbl-dart/cbl-dart · GitHub

The 'CBL Scheduler" thread can apparently crash after a connection timed out.

I/flutter (16733): 10:30:10.821788| [DB] error: mbedTLS(C): mbedtls_ssl_handle_message_type() returned -30848 (-0x7880)
I/flutter (16733): 10:30:10.927484| [DB] error: mbedTLS(C): mbedtls_ssl_read_record() returned -30848 (-0x7880)
I/flutter (16733): 10:30:10.930672| [WS] warning: ClientSocket got POSIX error 104 "Connection reset by peer"
I/flutter (16733): 10:30:10.934116| [Sync] error: {Repl#1} Got LiteCore error: Network error 3, "connection timed out"
I/flutter (16733): 10:30:11.567368| [Sync] error: {C4Replicator#5} Transient error (Network error 3, "connection timed out"); attempt #2 in 2 sec...
D/OneID:LogGoSender(16733): Event sent // service:refresh:token
F/libc    (16733): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x48 in tid 16850 (CBL Scheduler#1), pid 16733 (atabase.example)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'google/sdk_gphone_x86_64/emu64xa:13/TE1A.220922.025/9795748:userdebug/dev-keys'
Revision: '0'
ABI: 'x86_64'
Timestamp: 2023-10-16 10:30:12.480931573-0700
Process uptime: 51s
Cmdline: com.disney.mobile_chassis.database.example
pid: 16733, tid: 16850, name: CBL Scheduler#1  >>> com.disney.mobile_chassis.database.example <<<
uid: 10164
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0000000000000048
Cause: null pointer dereference
    rax 0000781e8a3b5aa4  rbx 0000000000000003  rcx 0000000000000750  rdx 0000000000000750
    r8  fffffffffffc08c0  r9  0000782028c72c00  r10 0000000000000000  r11 0000000000000206
    r12 0000000000000000  r13 0000000000000000  r14 0000006800000002  r15 000078200988ae10
    rdi 0000000000000000  rsi 0000782028c72be0
    rbp 0000781f28cd3e90  rsp 0000781e854173c0  rip 0000781e8a3b4719
backtrace:
      #00 pc 000000000028b719  /data/app/~~hZ76OBNIj-phbbMBOr89qw==/com.disney.mobile_chassis.database.example-R8U9aKSpn9Cp8UU6nH_20g==/base.apk!libcblite.so (BuildId: 94ae4fc48f1401440fc241af103eb486fce9c595)
      #01 pc 00000000002b667f  /data/app/~~hZ76OBNIj-phbbMBOr89qw==/com.disney.mobile_chassis.database.example-R8U9aKSpn9Cp8UU6nH_20g==/base.apk!libcblite.so (BuildId: 94ae4fc48f1401440fc241af103eb486fce9c595)
      #02 pc 00000000002b5ba8  /data/app/~~hZ76OBNIj-phbbMBOr89qw==/com.disney.mobile_chassis.database.example-R8U9aKSpn9Cp8UU6nH_20g==/base.apk!libcblite.so (BuildId: 94ae4fc48f1401440fc241af103eb486fce9c595)
      #03 pc 00000000002b4eff  /data/app/~~hZ76OBNIj-phbbMBOr89qw==/com.disney.mobile_chassis.database.example-R8U9aKSpn9Cp8UU6nH_20g==/base.apk!libcblite.so (BuildId: 94ae4fc48f1401440fc241af103eb486fce9c595)
      #04 pc 00000000002b74c2  /data/app/~~hZ76OBNIj-phbbMBOr89qw==/com.disney.mobile_chassis.database.example-R8U9aKSpn9Cp8UU6nH_20g==/base.apk!libcblite.so (BuildId: 94ae4fc48f1401440fc241af103eb486fce9c595)
      #05 pc 00000000000ccd2a  /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+58) (BuildId: 007cb2313464df63debf8020e631c990)
      #06 pc 0000000000060d37  /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+55) (BuildId: 007cb2313464df63debf8020e631c990)
Lost connection to device.

I was unable to symbolicate the stack trace because the binaries for the current CBL C SDK for Android don’t contain debug symbols anymore. It would be great if those debug symbols could be made available, maybe as a separate archive, if this was a deliberate decision.

It’s hard to debug with this much info; “Connection timed out” does not always crash the the thread of “CBL Scheduler.” If you could repro it, would you please get the logs, preferably at the Verbose level?