flutter-webrtc: App crashes at the end of the call
Describe the bug Sometimes, when the call ends, the application crashes.
Android log
[ +3 ms] I/flutter (10236): [2021-12-03 15:57:04.308] Level.debug rtc_session.dart:1246 ::: receiveRequest()
[ +170 ms] I/AudioTrack(10236): isLongTimeZoreData zoer date time 1 Seconds
[ +781 ms] I/org.webrtc.Logging(10236): CameraStatistics: Camera fps: 19.
[ +352 ms] I/org.webrtc.Logging(10236): EglBase14Impl: Using OpenGL ES version 2
[ +2 ms] E/org.webrtc.Logging(10236): SurfaceTextureHelper: decoder-texture-thread create failure
[ ] E/org.webrtc.Logging(10236): SurfaceTextureHelper: java.lang.RuntimeException: Failed to create EGL context: 0x3003
[ ] E/org.webrtc.Logging(10236): SurfaceTextureHelper: java.lang.RuntimeException: Failed to create EGL context: 0x3003
[ ] E/org.webrtc.Logging(10236): at org.webrtc.EglBase14Impl.createEglContext(EglBase14Impl.java:282)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.EglBase14Impl.<init>(EglBase14Impl.java:78)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.EglBase$-CC.createEgl14(EglBase.java:215)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.EglBase$-CC.create(EglBase.java:158)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.SurfaceTextureHelper.<init>(SurfaceTextureHelper.java:187)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.SurfaceTextureHelper.<init>(SurfaceTextureHelper.java:33)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.SurfaceTextureHelper$1.call(SurfaceTextureHelper.java:75)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.SurfaceTextureHelper$1.call(SurfaceTextureHelper.java:70)
[ ] E/org.webrtc.Logging(10236): at org.webrtc.ThreadUtils$3.run(ThreadUtils.java:173)
[ ] E/org.webrtc.Logging(10236): at android.os.Handler.handleCallback(Handler.java:938)
[ ] E/org.webrtc.Logging(10236): at android.os.Handler.dispatchMessage(Handler.java:99)
[ ] E/org.webrtc.Logging(10236): at android.os.Looper.loop(Looper.java:236)
[ ] E/org.webrtc.Logging(10236): at android.os.HandlerThread.run(HandlerThread.java:67)
[ +7 ms] W/System.err(10236): java.lang.NullPointerException: Attempt to invoke virtual method 'android.graphics.SurfaceTexture org.webrtc.SurfaceTextureHelper.getSurfaceTexture()' on a null object reference
[ ] W/System.err(10236): at org.webrtc.AndroidVideoDecoder.initDecode(AndroidVideoDecoder.java:154)
[ +2 ms] E/rtc (10236): #
[ ] E/rtc (10236): # Fatal error in: gen/sdk/android/generated_metrics_jni/../../../../../../sdk/android/src/jni/jni_generator_helper.h, line 94
[ ] E/rtc (10236): # last system error: 0
[ ] E/rtc (10236): # Check failed: !env->ExceptionCheck()
[ ] E/rtc (10236): #
[ +7 ms] F/libc (10236): Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 20278 (DecodingQueue -), pid 10236 (le.appname)
iOS log
Call-ID: l37fpb0488o53z6w5e7h
CSeq: 2 BYE
Supported: outbound
Content-Length: 0
flutter: [2021-12-22 17:12:44.868] Level.debug rtc_session.dart:2931 ::: session ended
flutter: [2021-12-22 17:12:44.869] Level.debug rtc_session.dart:1474 ::: close()
flutter: [2021-12-22 17:12:44.872] Level.debug rtc_session.dart:2934 ::: emit "ended"
* thread #40, queue = 'com.apple.coremedia.compressionsession.clientcallback', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x0000000101576444 WebRTC`___lldb_unnamed_symbol3987$$WebRTC + 260
WebRTC`___lldb_unnamed_symbol3987$$WebRTC:
-> 0x101576444 <+260>: ldr x8, [x0]
0x101576448 <+264>: ldr x8, [x8, #0x10]
0x10157644c <+268>: add x1, sp, #0xf98 ; =0xf98
0x101576450 <+272>: add x2, sp, #0x7d0 ; =0x7d0
Target 0: (Runner) stopped.
Lost connection to device.
To Reproduce Start a call, wait 5-10 seconds, end the call. Sometimes the error occurs on the first try, sometimes it takes 10-20 attempts.
Expected behavior The app continues working
Platform information:
Flutter version:
Details
[✓] Flutter (Channel stable, 2.5.3, on macOS 12.0.1 21A559 darwin-x64, locale en-GB)
• Flutter version 2.5.3 at /Users/user/Desktop/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (7 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.0, Build version 13A233
• CocoaPods version 1.11.2
Plugin version: Encountered this issue on versions 0.6.8, 0.6.9, 0.6.10 + hotfix.1, and 0.7.1
OS: Android and iOS
OS version: Android 11(MIUI 12.5.8), iOS 15.1
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 18 (6 by maintainers)
Commits related to this issue
- https://github.com/flutter-webrtc/flutter-webrtc/issues/793 — committed to turingvideo/flutter-webrtc by cnwangxiao 2 years ago
- https://github.com/flutter-webrtc/flutter-webrtc/issues/793 — committed to turingvideo/flutter-webrtc by cnwangxiao 2 years ago
- https://github.com/flutter-webrtc/flutter-webrtc/issues/793 — committed to turingvideo/flutter-webrtc by cnwangxiao 2 years ago
- https://github.com/flutter-webrtc/flutter-webrtc/issues/793 — committed to turingvideo/flutter-webrtc by cnwangxiao 2 years ago
- https://github.com/flutter-webrtc/flutter-webrtc/issues/793 — committed to turingvideo/flutter-webrtc by cnwangxiao 2 years ago
can we make a PR with the fix