opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
210 stars 169 forks source link

Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 32370 (Thread-22), pid 31945 #443

Closed VadimEksler closed 1 year ago

VadimEksler commented 1 year ago

Describe the bug Fatal signal 6 CRASH

To Reproduce no specific steps

Expected behavior don't crash

Device (please compete the following information): Google Pixel 6 with Android 13 opentok-android-sdk:2.24.1

Additional context


2023-01-10 09:29:30.420 31945-32370 libc++abi E Pure virtual function called! 2023-01-10 09:29:30.420 31945-32370 libc A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 32370 (Thread-22), pid 31945 (app_name) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Build fingerprint: 'google/oriole/oriole:13/TQ1A.221205.011/9244662:user/release-keys' 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Revision: 'MP1.0' 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A ABI: 'arm64' 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Timestamp: 2023-01-10 09:29:30.605894985+0200 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Process uptime: 336s 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Cmdline: app_name 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A pid: 31945, tid: 32370, name: Thread-22 >>> app_name <<< 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A uid: 10283 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A tagged_addr_ctrl: 0000000000000001 (PR_TAGGED_ADDR_ENABLE) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A Abort message: 'Pure virtual function called!' 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x0 0000000000000000 x1 0000000000007e72 x2 0000000000000006 x3 0000007abacc18a0 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x4 0000000000000010 x5 0000000000000010 x6 0000000000000010 x7 7f7f7f7f7f7f7f7f 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x8 00000000000000f0 x9 0000007e459079e0 x10 0000000000000001 x11 0000007e459486e0 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x12 000000003b9ac9ff x13 000000007fffffff x14 000000000cb789fc x15 000017d6e080df1d 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x16 0000007e459b5d50 x17 0000007e45991220 x18 0000007abaa86000 x19 0000000000007cc9 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x20 0000000000007e72 x21 00000000ffffffff x22 ffffff80ffffffc8 x23 0000007abacc1af0 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x24 0000007abacc19d0 x25 0000007abacc1a10 x26 b400007bd264f550 x27 00000000000fc000 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A x28 00000000000fe000 x29 0000007abacc1920 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A lr 0000007e459391c8 sp 0000007abacc1880 pc 0000007e459391f4 pst 0000000000001000 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A backtrace: 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #00 pc 00000000000531f4 /apex/com.android.runtime/lib64/bionic/libc.so (abort+164) (BuildId: 1154186c46119a81daca3db1a6b68111) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #01 pc 0000000000b9aa2c /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #02 pc 0000000000baf420 /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (cxa_pure_virtual+16) (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #03 pc 00000000004cf400 /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #04 pc 00000000004ceacc /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #05 pc 00000000004c899c /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #06 pc 00000000004d2ce0 /data/app/~~Y49UMtlYCJEF2_PK9qaLVQ==/app_name-bBd5zo8ZGs5KQGba1crBFQ==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #07 pc 00000000000c15dc /apex/com.android.runtime/lib64/bionic/libc.so (pthread_start(void*)+204) (BuildId: 1154186c46119a81daca3db1a6b68111) 2023-01-10 09:29:31.415 32577-32577 DEBUG pid-32577 A #08 pc 0000000000054a30 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64) (BuildId: 1154186c46119a81daca3db1a6b68111)

v-kpheng commented 1 year ago

@VadimEksler, thanks for filing this issue. That said, without steps to reproduce, it makes root cause difficult.

Can you share steps to reproduce please? Thanks!

jinglebiscuitsHL commented 1 year ago

Not much more info, but this just crashed for me as well.

Describe the bug Fatal signal 6 CRASH

To Reproduce Call was connected for several minutes then the crash happened without any user interaction

Expected behavior don't crash

Device (please compete the following information): Google Pixel 7 with Android 13 opentok-android-sdk:2.24.1

Additional context

2023-01-23 16:08:35.020 6970-7534/[APP NAME] E/libc++abi: Pure virtual function called!

--------- beginning of crash

2023-01-23 16:08:35.021 6970-7534/[APP NAME] A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 7534 (Thread-23), pid 6970 (vipaar.lime.dev) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: Cmdline: [APP NAME] 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: pid: 6970, tid: 7534, name: Thread-23 >>> [APP NAME] <<< 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #01 pc 0000000000b9aa2c /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #02 pc 0000000000baf420 /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (__cxa_pure_virtual+16) (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #03 pc 00000000004cf400 /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #04 pc 00000000004ceacc /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #05 pc 00000000004c899c /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52) 2023-01-23 16:08:35.824 8330-8330/? A/DEBUG: #06 pc 00000000004d2ce0 /data/app/~~jRtj-rrT2Fez_l4UJZjEKA==/[APP NAME]-Z1_Vsn4vs62zsEXMis95zA==/lib/arm64/libopentok.so (BuildId: 57412c81742d3a3904f5f6545dc3514ac9735a52)

v-kpheng commented 1 year ago

@jinglebiscuitsHL:

ricardosj commented 1 year ago

Hi @v-kpheng and all,

Since i've been spending a lot of time on this one, i'm stepping forward to share my findings here, as it might help someone.

That's the simplest way i was able to reproduce the 'stack corruption' problem here, using the plain Basic-Video-Chat-Kotlin demo:

  1. Grabbed 3 sessionIds + Token pairs to play with: . One sessionId + token pair, that i generated from the Dashboard, accepting the defaults 'Routed' Media Mode and 'Publisher' Role . One sessionId + token pair from Video API Playground, choosing 'Routed' Media Mode, for the publisher role . One sessionId + token pair from Video API Playground, choosing 'Relayed' Media Mode, for the publisher role

  2. Two devices were plugged in Android Studio (Android tablet + Android cellphone). The Basic-Video-Chat-Kotlin sample is run in both devices, as to see they connecting to one another, and make sure the connection holds without errors. Each sessionId + token pair was filled in the OpenTokConfig.kt file, so 3 different runs were performed in sequence.

  3. As a result, testing the connections using the first and second pairs described above worked well. When using the third pair, that is, the one that used the relayed session mode, crashed a few seconds after connecting:

2023-07-28 00:33:24.068 26212-26298 libc com.tokbox.sample.basicvideochat A stack corruption detected (-fstack-protector) 2023-07-28 00:33:24.069 26212-26298 libc com.tokbox.sample.basicvideochat A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 26298 (Thread-6), pid 26212 (.basicvideochat)

That's it. Note that downgrading the version and modifying proguard's file did not solve the problem in my case. I'm using version 2.25.3, compiling for Android SDK33.

So my solution for now is to stick with the routed media mode, which is 100% stable btw.

Regards