livekit / client-sdk-android

LiveKit SDK for Android
https://docs.livekit.io
Apache License 2.0
160 stars 63 forks source link

libjingle_peerconnection_so crash #360

Open kendo6666 opened 5 months ago

kendo6666 commented 5 months ago

When I do stress testing on Android(HUAWEI/HONOR) and call the SDK( v1.5.3) dozens of times, libjingle_peerconnection_so crash occurs and the phone must be retarted.

2024-01-18 15:59:55.375 3561-4044 rtc com.example.gecko E

                                                                                                #
                                                                                                # Fatal error in: gen/jni_headers/sdk/android/generated_metrics_jni/../../../../../../../sdk/android/src/jni/jni_generator_helper.h, line 95
                                                                                                # last system error: 0
                                                                                                # Check failed: !env->ExceptionCheck()
                                                                                                # 

2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E
2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E
2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E # 2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E # Fatal error in: gen/jni_headers/sdk/android/generated_metrics_jni/../../../../../../../sdk/android/src/jni/jni_generator_helper.h, line 95 2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E # last system error: 0 2024-01-18 15:59:55.375 3561-3907 GoLog com.example.myphone E # Check failed: !env->ExceptionCheck() 2024-01-18 15:59:55.375 3561-4044 libc com.example.myphone A Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 4044 (network_thread ), pid 3561 (m.example.myphone) 2024-01-18 15:59:55.439 4086-4086 DEBUG pid-4086 A 2024-01-18 15:59:55.439 4086-4086 DEBUG pid-4086 A Build fingerprint: 'HONOR/HLK-AL00/HWHLK-H:10/HONORHLK-AL00/103.0.0.168C00:user/release-keys' 2024-01-18 15:59:55.439 4086-4086 DEBUG pid-4086 A Revision: '0' 2024-01-18 15:59:55.439 4086-4086 DEBUG pid-4086 A ABI: 'arm64' 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A SYSVMTYPE: Maple APPVMTYPE: Art 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A Timestamp: 2024-01-18 15:59:55+0800 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A pid: 3561, tid: 4044, name: network_thread >>> com.example.myphone <<< 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A uid: 10246 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x0 0000000000000000 x1 0000000000000fcc x2 0000000000000006 x3 000000737d1fb5a0 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 7f7f7f7f7f7f7f7f 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x8 00000000000000f0 x9 93f4292b545882b4 x10 0000000000000001 x11 0000000000000000 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x12 fffffff0fffffbdf x13 ffffffffffffffff x14 0000000000000004 x15 ffffffffffffffff 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x16 000000740e4f3a08 x17 000000740e4d37c0 x18 00000072a21be000 x19 0000000000000de9 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x20 0000000000000fcc x21 00000000ffffffff x22 00000072b687439c x23 0000000000000001 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x24 000000737d1fba70 x25 0000000000000004 x26 0000000000000001 x27 0000000000000004 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A x28 0000000000000004 x29 000000737d1fb640 2024-01-18 15:59:55.441 4086-4086 DEBUG pid-4086 A sp 000000737d1fb580 lr 000000740e488640 pc 000000740e48866c 2024-01-18 15:59:55.442 4086-4086 DEBUG pid-4086 A
backtrace: 2024-01-18 15:59:55.442 4086-4086 DEBUG pid-4086 A #00 pc 000000000007066c /apex/com.android.runtime/lib64/bionic/libc.so (abort+160) (BuildId: b91c775ccc9b0556e91bc575a2511cd0) 2024-01-18 15:59:55.442 4086-4086 DEBUG pid-4086 A #01 pc 0000000000417918 /data/app/com.example.myphone-EkU2mdlcNaJm-3kvl6vZhw==/base.apk!libjingle_peerconnection_so.so (offset 0x3c0f000) (BuildId: 84a27739ad64cdf7)

No Android error information is captured. Is this because an exception occurred in other JNI function calls between the crashes, and the SDK did not capture it?

Thanks

@davidliu

wzJun1 commented 5 months ago

+1

JunzhuoZhang commented 3 months ago

same problem +1

hoale90 commented 3 months ago

the same problem +1. How can we fix it, guys?

ayushagrawal8 commented 1 month ago

I am also experiencing libwebrtc crash with the above error code.For me the situation is specific ,When i try to publish my track with simulcast turned on ,createEncoder method in CustomVideoEncoderFactory.kt is called and it crashes.Most probably crash is linked to HW encoder.