Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Samsung Crash #29

Open
1 of 2 tasks
ChristianConstantNel opened this issue Mar 9, 2023 · 20 comments
Open
1 of 2 tasks

Samsung Crash #29

ChristianConstantNel opened this issue Mar 9, 2023 · 20 comments
Labels
bug Something isn't working

Comments

@ChristianConstantNel
Copy link

Version

v1.1.1

Which operating systems have you used?

  • Android
  • iOS

Environment that reproduces the issue

Physical Samsung Galaxy S7

Is it reproducible in the example application?

Yes

RTMP Server

'rtmp://global-live.mux.com:5222/app/

Reproduction steps

Use example provided

  • Navigate to LiveViewPage
  • App Crashes

Expected result

App should not crash

Actual result

App crashes

Additional context

No response

Relevant logs output

D/ViewRootImpl@d6c4f08[MainActivity](14971): ViewPostIme pointer 0
D/ViewRootImpl@d6c4f08[MainActivity](14971): ViewPostIme pointer 1
F/libc    (14971): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x5 in tid 14971 (m.sportcentrall)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Build fingerprint: 'samsung/heroltexx/herolte:8.0.0/R16NW/G930FXXU8ETI2:user/release-keys'
Revision: '8'
ABI: 'arm64'
pid: 14971, tid: 14971, name: m.sportcentrall  >>> com.sportcentrall <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5
Cause: null pointer dereference
    x0   0000000000000005  x1   0000000000000000  x2   00000079cdca4ad6  x3   0000000000000000
    x4   0000000000000000  x5   0000000000000000  x6   0000000000000000  x7   0000000000000010
    x8   bad1f15c3c8f235d  x9   bad1f15c3c8f235d  x10  0000007b2fe0d670  x11  0000000000000002
    x12  0000007b2fe0d688  x13  0000000000000020  x14  000000000000000d  x15  aaaaaaaaaaaaaaab
    x16  0000007b32a33588  x17  0000007b32b38430  x18  00000079cdcbc480  x19  0000000000000005
    x20  0000000000000000  x21  0000007b00305440  x22  0000000000000000  x23  0000000000000000
    x24  0000000000000000  x25  00000079cdca4ad6  x26  0000000000000000  x27  0000000000000005
    x28  0000000000000001  x29  0000007ff02764e0  x30  0000007b328e3258
    sp   0000007ff02764e0  pc   0000007b32b38430  pstate 0000000060000000
backtrace:
    #00 pc 0000000000069430  /system/lib64/libc.so (pthread_rwlock_wrlock)
    #01 pc 00000000001e5254  /system/lib64/libandroid_runtime.so (CRYPTO_STATIC_MUTEX_lock_write+8)
    #02 pc 00000000002491bc  /system/lib64/libandroid_runtime.so (CRYPTO_get_ex_new_index+76)
    #03 pc 000000000002af44  /data/app/com.sportcentrall-GtNBq8OIAxIYYFRsZ8fMRQ==/lib/arm64/libssl.so
@ChristianConstantNel ChristianConstantNel added the bug Something isn't working label Mar 9, 2023
@ChristianConstantNel
Copy link
Author

Did some more testing,

Crash seems to happen once controller get's initialised.

@ThibaultBee
Copy link
Member

Hi,
Thanks for reporting the issue.
Unfortunately, I don't understand the reproduction steps, you just open the application and it crashes? Is that it? Or do you have an example to provide?

@ChristianConstantNel
Copy link
Author

Hi,

I have a basic app, the main page has a button to navigate to the example LiveViewPage.
Once you click on that button to navigate to the page, the app crashes.

It seems to be when the controller gets initialised.

@ThibaultBee
Copy link
Member

Could you share your application with us? so we quickly debug it.

@ChristianConstantNel
Copy link
Author

Sure,

Here is the link:

https://github.com/ChristianConstantNel/stream.git

@ChristianConstantNel
Copy link
Author

Hi,

Just a follow up.

Tested your example app, and app still crashes.

Here is the logs:

D/ViewRootImpl@469b22aMainActivity: MSG_WINDOW_FOCUS_CHANGED 0
D/libGLESv2( 4945): STS_GLApi : DTS, ODTC are not allowed for Package : video.api.flutter.livestream.example
D/ViewRootImpl@469b22aMainActivity: Relayout returned: old=[0,0][1080,1920] new=[0,0][1080,1920] result=0x1 surface={valid=true 528777465856} changed=false
E/MethodChannel#video.api.livestream/controller( 4945): Failed to handle method call
E/MethodChannel#video.api.livestream/controller( 4945): java.lang.NullPointerException
E/MethodChannel#video.api.livestream/controller( 4945): at video.api.flutter.livestream.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:125)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Handler.handleCallback(Handler.java:789)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Handler.dispatchMessage(Handler.java:98)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Looper.loop(Looper.java:164)
E/MethodChannel#video.api.livestream/controller( 4945): at android.app.ActivityThread.main(ActivityThread.java:6944)
E/MethodChannel#video.api.livestream/controller( 4945): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#video.api.livestream/controller( 4945): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/MethodChannel#video.api.livestream/controller( 4945): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
E/MethodChannel#video.api.livestream/controller( 4945): Failed to handle method call
E/MethodChannel#video.api.livestream/controller( 4945): java.lang.NullPointerException
E/MethodChannel#video.api.livestream/controller( 4945): at video.api.flutter.livestream.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:101)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/MethodChannel#video.api.livestream/controller( 4945): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Handler.handleCallback(Handler.java:789)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Handler.dispatchMessage(Handler.java:98)
E/MethodChannel#video.api.livestream/controller( 4945): at android.os.Looper.loop(Looper.java:164)
E/MethodChannel#video.api.livestream/controller( 4945): at android.app.ActivityThread.main(ActivityThread.java:6944)
E/MethodChannel#video.api.livestream/controller( 4945): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#video.api.livestream/controller( 4945): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/MethodChannel#video.api.livestream/controller( 4945): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
D/ViewRootImpl@469b22aMainActivity: MSG_WINDOW_FOCUS_CHANGED 1
V/InputMethodManager( 4945): Starting input: tba=android.view.inputmethod.EditorInfo@b0e53cf nm : video.api.flutter.livestream.example ic=null
I/InputMethodManager( 4945): startInputInner - mService.startInputOrWindowGainedFocus
F/libc ( 4945): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x5 in tid 4945 (estream.example)


Build fingerprint: 'samsung/heroltexx/herolte:8.0.0/R16NW/G930FXXU8ETI2:user/release-keys'
Revision: '8'
ABI: 'arm64'
pid: 4945, tid: 4945, name: estream.example >>> video.api.flutter.livestream.example <<<
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x5
Cause: null pointer dereference
x0 0000000000000005 x1 0000000000000000 x2 0000007b02bc5ad6 x3 0000000000000000
x4 0000000000000000 x5 0000000000000000 x6 0000000000000000 x7 00000000008d9dd0
x8 bad1f15c3c8f235d x9 bad1f15c3c8f235d x10 0000007b2fe0d670 x11 0000000000000002
x12 0000007b2fe0d688 x13 0000000000000020 x14 000000000000000d x15 aaaaaaaaaaaaaaab
x16 0000007b32a33588 x17 0000007b32b38430 x18 0000007b02bdd480 x19 0000000000000005
x20 0000000000000000 x21 0000007b0070ef00 x22 0000000000000000 x23 0000000000000000
x24 0000000000000000 x25 0000007b02bc5ad6 x26 0000000000000000 x27 0000000000000005
x28 0000000000000001 x29 0000007ff0275590 x30 0000007b328e3258
sp 0000007ff0275590 pc 0000007b32b38430 pstate 0000000060000000
backtrace:
#00 pc 0000000000069430 /system/lib64/libc.so (pthread_rwlock_wrlock)
#1 pc 00000000001e5254 /system/lib64/libandroid_runtime.so (CRYPTO_STATIC_MUTEX_lock_write+8)
#2 pc 00000000002491bc /system/lib64/libandroid_runtime.so (CRYPTO_get_ex_new_index+76)
#3 pc 000000000002af44 /data/app/video.api.flutter.livestream.example-1ZBy40SSEcdhMAsiciRDyg==/lib/arm64/libssl.so

@ChristianConstantNel
Copy link
Author

Another update:

Tested it on a Samsung S9, same issue.

More logs:

E/flutter ( 4077): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, null, null, java.lang.NullPointerException
E/flutter ( 4077): at video.api.flutter.livestream.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:101)
E/flutter ( 4077): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258)
E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322)
E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/flutter ( 4077): at android.os.Handler.handleCallback(Handler.java:789)
E/flutter ( 4077): at android.os.Handler.dispatchMessage(Handler.java:98)
E/flutter ( 4077): at android.os.Looper.loop(Looper.java:164)
E/flutter ( 4077): at android.app.ActivityThread.main(ActivityThread.java:6938)
E/flutter ( 4077): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 4077): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
E/flutter ( 4077): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
E/flutter ( 4077): )
E/flutter ( 4077): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:653
E/flutter ( 4077): #1 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:315
E/flutter ( 4077):
E/flutter ( 4077):

@ChristianConstantNel ChristianConstantNel changed the title Android Crash Samsung Crash Mar 13, 2023
@ChristianConstantNel
Copy link
Author

Another update:

Tested example app on an HTC one phone, everything worked.

Issue might be Samsung related?

@ThibaultBee
Copy link
Member

ThibaultBee commented Mar 13, 2023

Hi,

This issue is not going to be easy.
I am not sure it is Samsung related as their are no specific device features involve at this point.
It seems there is an crash in openssl internally. All I can find about a similar issue: hhttps://github.com/openssl/openssl/issues/11885. Unfortumately, it is not solved.
I could try to upgrade to openssl 3.0.8 (current is openssl 3.0.7) but not sure it will fix anything.

Also what method throws this crash?

Could you try to reproduce it with the native library as it would be easier to debug https://github.com/ThibaultBee/StreamPack/suites/11387220558/artifacts/586054880

@ChristianConstantNel
Copy link
Author

Thanks for the reply,

I'll test the native library and let you know.

It's the initialise method on the controller that throws the crash.

@ChristianConstantNel
Copy link
Author

Just tested the native app, and everything worked fine.

@ThibaultBee
Copy link
Member

ThibaultBee commented Mar 13, 2023

As it is described in this bug, it seems to be related to a race condition.
We won't be able to debug this.

@ChristianConstantNel
Copy link
Author

Do you have any suggestions for how we can go about trying to fix this?

We really love your package, but cannot use it without Samsung support.

@ThibaultBee
Copy link
Member

I understand, but I am sorry to say that I don't see anything to fix the issue you face.

@ChristianConstantNel
Copy link
Author

I understand.

Do you think if we build a native view for android that shows the streamPack view inside our flutter app, that it might work?

@ThibaultBee
Copy link
Member

This is what this library is doing

@ChristianConstantNel
Copy link
Author

So there is no way to work around this issue?

@ChristianConstantNel
Copy link
Author

ChristianConstantNel commented Mar 14, 2023

Quick update:

Tested it on a Samsung Galaxy S9 Plus, and it worked.

All the phones that had this issue ran on Android 8.0.0

@ThibaultBee
Copy link
Member

Hi,

I don't have a phone with Android 8.0.0. I just tested with a Pixel 6 Android 8.0 emulator but it does not crash.
We can't fix this issue.

@ThibaultBee
Copy link
Member

Another update:

Tested it on a Samsung S9, same issue.

More logs:

E/flutter ( 4077): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(error, null, null, java.lang.NullPointerException E/flutter ( 4077): at video.api.flutter.livestream.MethodCallHandlerImpl.onMethodCall(MethodCallHandlerImpl.kt:101) E/flutter ( 4077): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:258) E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:322) E/flutter ( 4077): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12) E/flutter ( 4077): at android.os.Handler.handleCallback(Handler.java:789) E/flutter ( 4077): at android.os.Handler.dispatchMessage(Handler.java:98) E/flutter ( 4077): at android.os.Looper.loop(Looper.java:164) E/flutter ( 4077): at android.app.ActivityThread.main(ActivityThread.java:6938) E/flutter ( 4077): at java.lang.reflect.Method.invoke(Native Method) E/flutter ( 4077): at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) E/flutter ( 4077): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) E/flutter ( 4077): ) E/flutter ( 4077): #0 StandardMethodCodec.decodeEnvelope package:flutter/…/services/message_codecs.dart:653 E/flutter ( 4077): #1 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:315 E/flutter ( 4077): E/flutter ( 4077):

This issue is supposed to be fixed in the main. It was due to a force unwrap of a null value when calling (stopPreview or stopStream while controller has not been initialized).

About your initial ssl issue (the one with CRYPTO_STATIC_MUTEX_lock_write), I still have no clue why this is happening. Anyway, we have updated ssl version since last time, could you try to reproduce this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants