BelledonneCommunications / linphone-android

Linphone.org mirror for linphone-android (https://gitlab.linphone.org/BC/public/linphone-android)
https://linphone.org
GNU General Public License v3.0
1.11k stars 680 forks source link

App crashes upon start in KNOX 3.8 on Android 12 (Samsung A33) #1704

Closed screenio5 closed 2 years ago

screenio5 commented 2 years ago

Describe the bug Whan app is started INSIDE Samsung KNOX, app crashes immediately

To Reproduce Steps to reproduce the behavior:

  1. Install latest 4.7.0 ("linphone-android-release-4.7.0-alpha.231+622275812.apk" as of this writing)
  2. Go into KNOX "Secure Folder" and add the app into KNOX and run it from inside KNOX
  3. While in the KNOX app instance, add a SIP account and make sure it connects and works
  4. Do NOT uninstall the app from outside KNOX yet.
  5. Restart phone and run app from INSIDE KNOX. It should work fine
  6. Now uninstall the app from outside KNOX
  7. Run app from INSIDE KNOX (it doesnt exist outside KNOX anymore). It still should work fine
  8. Restart phone
  9. Run app from INSIDE KNOX (it doesnt exist outside KNOX anymore). APP CRASHES and will never work from now on!
  10. The only way to make it work again (in KNOX) is to re-install it outside KNOX. It seems as if when run inside KNOX it needs to locate and find something OUTSIDE KNOX.

The above behavior did not occur prior to Android 12 & KNOX 3.8

Please complete the following information

SDK logs Cant have logs as app crashes immediately upon start

Additional context Up to Android 11 running Samsung KNOX 3.7 app was working always fine INSIDE KNOX

Viish commented 2 years ago

Hi, Can you attach the crash's stacktrace please?

screenio5 commented 2 years ago

Ofc, but how can I get the stacktrace since the app crashes upon startup? Can you please provide instructions?

Viish commented 2 years ago

Here you go: https://gitlab.linphone.org/BC/public/linphone-android#native-crash

screenio5 commented 2 years ago

Trying to follow your suggestion/instructions in [https://gitlab.linphone.org/BC/public/linphone-android#native-crash] I read:

  1. Go to our maven repository, in the linphone-android-debug directory.
  2. Download the AAR file with the exact same version as the AAR that was used to generate the crash's stacktrace.

So, I suppose I need to match the SDK debug directory (to be downloaded) with the SDK version reported in the "about" dialog of the Linphone app running in the phone. As stated above, it is reported as "SDK 5.2.0-alpha.195" A "195" version however isnt available to be downloaded. The closest are "194" and "196". Please advise

Viish commented 2 years ago

Did you build the SDK yourself?

screenio5 commented 2 years ago

No, all I have done is installed the app in the Phone. Dont even have Android Studio

Viish commented 2 years ago

You used one of our nightly snapshot?

screenio5 commented 2 years ago

Yes, that is correct.
This one: https://download.linphone.org/snapshots/android/linphone-android-release-4.7.0-alpha.231+622275812.apk

Viish commented 2 years ago

Ok I see what APK you used. Please use https://download.linphone.org/snapshots/android/linphone-android-debug-4.7.0-alpha.255+86cba063d.apk instead. -release APK files in snapshots are for out internal use only. I'll remove them.

screenio5 commented 2 years ago

Ok, I will remove the current version on the phone and install the one you say. Which SDK version must I download from the maven repository?

Viish commented 2 years ago

The one that will match the SDK version in About page.

screenio5 commented 2 years ago

I have now installed the https://download.linphone.org/snapshots/android/linphone-android-debug-4.7.0-alpha.255+86cba063d.apk as you suggested. I will try to create the native crash logs in the next 24 hours or so.

screenio5 commented 2 years ago

I just tried to follow the instructions "Native crash" at [https://gitlab.linphone.org/BC/public/linphone-android#native-crash] but failed. Executing "adb logcat -d | ndk-stack -sym ./libs-debug/adb shell getprop ro.product.cpu.abi | tr -d '\r' " results in "'tr' is not recognized as an internal or external command, operable program or batch file."

Please not that I dont have Android Studio installed. I have downloaded and trying to use these: 1) NDK from [https://developer.android.com/ndk/downloads] 2) the SDK manager from [https://developer.android.com/studio/intro/update#sdk-manager] 3) the SDK platform tools for Windows from [https://developer.android.com/studio/releases/platform-tools]

I am trying the best I can but instructions at "Native crash" are not clear enough for someone with zero experience in Android development. Maybe you can provide some more clear directions as to what I need to do?

Viish commented 2 years ago

Can you try using this: adb logcat -d | ndk-stack -sym ./libs-debug/arm64-v8a

screenio5 commented 2 years ago

Executing "adb logcat -d | ndk-stack -sym ./libs-debug/arm64-v8a" results to (with phone connected to laptop):

Viish commented 2 years ago

Do you see your device when you type adb devices?

screenio5 commented 2 years ago

List of devices attached RFCT50M3EBB device

Viish commented 2 years ago

Ok so it is detected. Have you tried running the command again?

By the way, while the command is running you have to reproduce the crash so the stack trace appears.

screenio5 commented 2 years ago

Same error:

adb logcat -d | ndk-stack -sym ./libs-debug/adb shell getprop ro.product.cpu.abi | tr -d '\r'

'tr' is not recognized as an internal or external command, operable program or batch file.

Viish commented 2 years ago

Keep using adb logcat -d | ndk-stack -sym ./libs-debug/arm64-v8a instead of the one in the README

screenio5 commented 2 years ago

ok, this command works, however what does it do? Where does it write so that I can send to you?

Viish commented 2 years ago

It will print in the shell the stacktrace when it will find one. Copy/paste it here after.

screenio5 commented 2 years ago

But how? Once I execute the command, after a couple of seconds it finishes and I get the command prompt again. There is no way for anything to print in the command line as nothing remains running.

Viish commented 2 years ago

That's not expected. It should run as long as you don't cancel it. Does it behaves the same if you simply do adb logcat?

screenio5 commented 2 years ago

For whatever reason it dumped to screen as soon as the app crashed and while I had re-executed the command. Here is the command line output:

** Crash dump: ** Build fingerprint: 'samsung/a33xnseea/a33x:12/SP1A.210812.016/A336BXXU1AVC9:user /release-keys' WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

00 0x0000000000e4df0c /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (BuildId: 3d34f584a2df8c71a5cb0 3d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

01 0x0000000000e4de88 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (dns_res_reset+108) (BuildId: 3 d34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

02 0x0000000000e4dcc0 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (dns_res_close+64) (BuildId: 3d 34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

03 0x0000000000e4dc00 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (dns_res_open+316) (BuildId: 3d 34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

04 0x0000000000e3a100 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (BuildId: 3d34f584a2df8c71a5cb0 3d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

05 0x0000000000e39d1c /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (belle_sip_stack_resolve_a+300) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

06 0x0000000000e3fba0 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (belle_sip_channel_resolve+116) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

07 0x0000000000e614d0 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (belle_sip_client_transaction_s end_request_to+400) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

08 0x0000000000c016bc /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::SalOp::sendRe questWithContact(_belle_sip_request*, bool)+1372) (BuildId: 3d34f584a2df8c71a5cb 03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

09 0x0000000000c02044 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::SalOp::sendRe quest(_belle_sip_request*)+400) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db 00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

10 0x0000000000c039f8 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::SalOp::sendRe questAndCreateRefresher(_belle_sip_request, int, void ()(belle_sip_refresher, void, unsigned int, char const*, int))+20) (BuildId: 3d34f584a2df8c71a5cb03d4e 0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

11 0x0000000000c07c7c /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::SalRegisterOp ::sendRegister(std::ndk1::basic_string<char, std::__ndk1::char_traits, s td::ndk1::allocator > const&, std::ndk1::basic_string<char, std::__ndk 1::char_traits, std::ndk1::allocator > const&, int, std::ndk1::l ist<SalAddress*, std::ndk1::allocator<SalAddress*> > const&)+844) (BuildId: 3d 34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

12 0x0000000000a77210 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::Account::regi sterAccount()+532) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00) WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

13 0x0000000000a75e90 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (LinphonePrivate::Account::upda te()+68) (BuildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00)

14 0x000000000006e9b8 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/libbctoolbox.so (bctbx_list_for_each+28) (Buil dId: e388a27b78dfb16bc7c6ae07eec474c3c6010c48)

                                               bctbx_list_for_each

                                               /builds/BC/public/linphone-sd

k/build/WORK/android-arm64/Build/bctoolbox/src../../../../../../bctoolbox/src/c ontainers\list.c:172:3 WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00 WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039

15 0x0000000000d26a00 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/lib/arm64/liblinphone.so (linphone_core_iterate+460) (Bu ildId: 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00)

16 0x00000000002d7644 /apex/com.android.art/lib64/libart.so (art_quickgeneric

jni_trampoline+148) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

17 0x00000000002cdd64 /apex/com.android.art/lib64/libart.so (art_quick_invoke_s

tub+548) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

18 0x00000000002f23d0 /apex/com.android.art/lib64/libart.so (art::interpreter::

ArtInterpreterToCompiledCodeBridge(art::Thread, art::ArtMethod, art::ShadowFra me, unsigned short, art::JValue)+312) (BuildId: 2b417e2566f5eb686666666b6ee952 ea)

19 0x00000000003ff868 /apex/com.android.art/lib64/libart.so (bool art::interpre

ter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art: :Instruction const, unsigned short, art::JValue)+820) (BuildId: 2b417e2566f5eb 686666666b6ee952ea)

20 0x00000000003fe764 /apex/com.android.art/lib64/libart.so (MterpInvokeDirect+

1580) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

21 0x00000000002c8514 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_di

rect+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

22 0x0000000000f83dda /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/oat/arm64/base.vdex (org.linphone.core.CoreImpl.iterate+ 130)

23 0x000000000027d748 /apex/com.android.art/lib64/libart.so (art::interpreter::

Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art:: JValue, bool, bool) (.llvm.7449118509010352383)+644) (BuildId: 2b417e2566f5eb686 666666b6ee952ea)

24 0x0000000000383478 /apex/com.android.art/lib64/libart.so (art::interpreter::

ArtInterpreterToInterpreterBridge(art::Thread, art::CodeItemDataAccessor const& , art::ShadowFrame, art::JValue*)+148) (BuildId: 2b417e2566f5eb686666666b6ee952 ea)

25 0x00000000003ffae0 /apex/com.android.art/lib64/libart.so (bool art::interpre

ter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art: :Instruction const, unsigned short, art::JValue)+1452) (BuildId: 2b417e2566f5e b686666666b6ee952ea)

26 0x00000000003dfa48 /apex/com.android.art/lib64/libart.so (MterpInvokeInterfa

ce+4912) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

27 0x00000000002c8614 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_in

terface+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

28 0x0000000000fb6ff0 /data/app/~~FlGkZTkKimkMMYdiEtryIw==/org.linphone.debug-w

MNJHdG4ngVZTvx8xmFeLA==/oat/arm64/base.vdex (org.linphone.core.tools.service.Cor eManager$3.run+20)

29 0x000000000027d748 /apex/com.android.art/lib64/libart.so (art::interpreter::

Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art:: JValue, bool, bool) (.llvm.7449118509010352383)+644) (BuildId: 2b417e2566f5eb686 666666b6ee952ea)

30 0x0000000000383478 /apex/com.android.art/lib64/libart.so (art::interpreter::

ArtInterpreterToInterpreterBridge(art::Thread, art::CodeItemDataAccessor const& , art::ShadowFrame, art::JValue*)+148) (BuildId: 2b417e2566f5eb686666666b6ee952 ea)

31 0x00000000003ffae0 /apex/com.android.art/lib64/libart.so (bool art::interpre

ter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art: :Instruction const, unsigned short, art::JValue)+1452) (BuildId: 2b417e2566f5e b686666666b6ee952ea)

32 0x00000000003dfa48 /apex/com.android.art/lib64/libart.so (MterpInvokeInterfa

ce+4912) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

33 0x00000000002c8614 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_in

terface+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

34 0x000000000048cecc /system/framework/framework.jar (android.os.Handler.handl

eCallback+4)

35 0x00000000007742a0 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+

2120) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

36 0x00000000002c8594 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_st

atic+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

37 0x000000000048cd40 /system/framework/framework.jar (android.os.Handler.dispa

tchMessage+8)

38 0x00000000002c37dc /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual

+2292) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

39 0x00000000002c8414 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_vi

rtual+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

40 0x00000000004ca022 /system/framework/framework.jar (android.os.Looper.loopOn

ce+334)

41 0x00000000007742a0 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+

2120) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

42 0x00000000002c8594 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_st

2120) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

42 0x00000000002c8594 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_st

atic+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

43 0x00000000004ca718 /system/framework/framework.jar (android.os.Looper.loop+1

52)

44 0x0000000000773cc4 /apex/com.android.art/lib64/libart.so (MterpInvokeStatic+

620) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

45 0x00000000002c8594 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_st

atic+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

46 0x00000000001bbf52 /system/framework/framework.jar (android.app.ActivityThre

ad.main+214)

47 0x000000000027d748 /apex/com.android.art/lib64/libart.so (art::interpreter::

Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art:: JValue, bool, bool) (.llvm.7449118509010352383)+644) (BuildId: 2b417e2566f5eb686 666666b6ee952ea)

48 0x000000000027c8f0 /apex/com.android.art/lib64/libart.so (artQuickToInterpre

terBridge+1176) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

49 0x00000000002d7778 /apex/com.android.art/lib64/libart.so (art_quick_to_inter

preter_bridge+88) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

50 0x00000000002cdfe8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_s

tatic_stub+568) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

51 0x0000000000362f0c /apex/com.android.art/lib64/libart.so (_jobject* art::Inv

okeMethod<(art::PointerSize)8>(art::ScopedObjectAccessAlreadyRunnable const&, _j object, _jobject, _jobject*, unsigned long)+608) (BuildId: 2b417e2566f5eb68666 6666b6ee952ea)

52 0x0000000000362c84 /apex/com.android.art/lib64/libart.so (art::Method_invoke

(_JNIEnv, _jobject, _jobject, _jobjectArray)+52) (BuildId: 2b417e2566f5eb686 666666b6ee952ea)

53 0x00000000000b2f74 /apex/com.android.art/javalib/arm64/boot.oat (art_jni_tra

mpoline+132) (BuildId: ad9ee401645a5135206a62ff86fc2ef5cdc29120)

54 0x00000000002cdd64 /apex/com.android.art/lib64/libart.so (art_quick_invoke_s

tub+548) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

55 0x00000000002f23d0 /apex/com.android.art/lib64/libart.so (art::interpreter::

ArtInterpreterToCompiledCodeBridge(art::Thread, art::ArtMethod, art::ShadowFra me, unsigned short, art::JValue)+312) (BuildId: 2b417e2566f5eb686666666b6ee952 ea)

56 0x00000000003ff868 /apex/com.android.art/lib64/libart.so (bool art::interpre

ter::DoCall<false, false>(art::ArtMethod, art::Thread, art::ShadowFrame&, art: :Instruction const, unsigned short, art::JValue)+820) (BuildId: 2b417e2566f5eb 686666666b6ee952ea)

57 0x00000000002c43ec /apex/com.android.art/lib64/libart.so (MterpInvokeVirtual

+5380) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

58 0x00000000002c8414 /apex/com.android.art/lib64/libart.so (mterp_op_invoke_vi

rtual+20) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

59 0x0000000000458e7a /system/framework/framework.jar (com.android.internal.os.

RuntimeInit$MethodAndArgsCaller.run+22)

60 0x000000000027d748 /apex/com.android.art/lib64/libart.so (art::interpreter::

Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art:: JValue, bool, bool) (.llvm.7449118509010352383)+644) (BuildId: 2b417e2566f5eb686 666666b6ee952ea)

61 0x000000000027c8f0 /apex/com.android.art/lib64/libart.so (artQuickToInterpre

terBridge+1176) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

62 0x00000000002d7778 /apex/com.android.art/lib64/libart.so (art_quick_to_inter

preter_bridge+88) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

63 0x0000000000ae71c8 /system/framework/arm64/boot-framework.oat (com.android.i

nternal.os.ZygoteInit.main+2376) (BuildId: abbb706ebfb3f3f9ff279e470d8d8bb691630 cc5)

64 0x00000000002cdfe8 /apex/com.android.art/lib64/libart.so (art_quick_invoke_s

tatic_stub+568) (BuildId: 2b417e2566f5eb686666666b6ee952ea)

65 0x00000000004550b4 /apex/com.android.art/lib64/libart.so (art::JValue art::I

nvokeWithVarArgs<_jmethodID>(art::ScopedObjectAccessAlreadyRunnable const&, _jo bject, _jmethodID*, std::__va_list)+464) (BuildId: 2b417e2566f5eb686666666b6ee9 52ea)

66 0x0000000000633790 /apex/com.android.art/lib64/libart.so (art::JNI::Ca

llStaticVoidMethodV(_JNIEnv, _jclass, _jmethodID*, std::__va_list)+268) (Build Id: 2b417e2566f5eb686666666b6ee952ea)

67 0x00000000000b2ac4 /system/lib64/libandroid_runtime.so (_JNIEnv::CallStaticV

oidMethod(_jclass, _jmethodID, ...)+120) (BuildId: c969ed538d679fba4bc11565cc4 c7caa)

68 0x00000000000beb68 /system/lib64/libandroid_runtime.so (android::AndroidRunt

ime::start(char const*, android::Vector const&, bool)+848) (Bu ildId: c969ed538d679fba4bc11565cc4c7caa)

69 0x00000000000025c8 /system/bin/app_process64 (main+1396) (BuildId: a26b3c8f0

adb2c16025825ba2227ee34)

70 0x000000000004980c /apex/com.android.runtime/lib64/bionic/libc.so (__libc_in

it+96) (BuildId: 1c37cae0a1a20a75f215af2188f648d5) Crash dump is completed

Viish commented 2 years ago

Thanks but it seems you aren't using the right libs-debug version according to these logs:

WARNING: Mismatched build id for ./libs-debug/arm64-v8a\liblinphone.so
WARNING: Expected 3d34f584a2df8c71a5cb03d4e0d5039e36f8db00
WARNING: Found 0e811165632c4c5fac2d145949d58a976ab12039
screenio5 commented 2 years ago

In the about dialog of the app which is version 4.7.0-alpha.255 it reports the SDK as 5.2.0-alpha.208+923454a

The SDK I have downloaded is: linphone-sdk-android-debug-5.2.0-alpha.208+923454a.aar

So, how come there is the mismatch?

Viish commented 2 years ago

That is surprising, I'll investigate.

Could you attach logs from the start of the to the moment it crashes using adb logcat command please? Start the command then start the app and copy/paste here everything reported by logcat.

Thanks in advance.

screenio5 commented 2 years ago

See attached. App as always crashed

_AppCrash.txt

Viish commented 2 years ago

Thanks. It seems it is a network access permission denial that's causing our DNS resolver to crash:

06-21 17:39:44.588  5291  5291 I Linphone: Creating listening point [0x7a00931730] on [sip:[::0]:-1;transport=UDP]
06-21 17:39:44.588  5291  5291 E Linphone: Cannot create UDP socket: Operation not permitted
06-21 17:39:44.588  5291  5291 I Linphone: Listening point [0x7a00931730] on [sip:[::0]:-1;transport=UDP] destroyed
06-21 17:39:44.588  5291  5291 I Linphone: Creating listening point [0x7a00931730] on [sip:[::0]:-1;transport=TCP]
06-21 17:39:44.588  5291  5291 E Linphone: Cannot create TCP socket: Operation not permitted
06-21 17:39:44.588  5291  5291 I Linphone: Listening point [0x7a00931730] on [sip:[::0]:-1;transport=TCP] destroyed
06-21 17:39:44.588  5291  5291 I Linphone: Creating listening point [0x7a00931730] on [sip:[::0]:-1;transport=TLS]
06-21 17:39:44.588  5291  5291 E Linphone: Cannot create TCP socket: Operation not permitted
[...]
06-21 17:39:45.252  5291  5291 E Linphone: get_local_ip_for_with_connect() could not create [AF_INET6] socket: Operation not permitted
06-21 17:39:45.252  5291  5291 E Linphone: get_local_ip_for_with_connect() could not create [AF_INET] socket: Operation not permitted
06-21 17:39:45.252  5291  5291 E Linphone: get_local_ip_for_with_connect() could not create [AF_INET] socket: Operation not permitted

I believe it's linked to KNOX but I don't know what/if you can do about it. Maybe this issue is related to this Android crash stack trace I can see in your logs:

06-21 17:39:44.972  1100  3956 W System.err: android.content.pm.PackageManager$NameNotFoundException: org.linphone.debug
06-21 17:39:44.972  1100  3956 W System.err:    at android.app.ApplicationPackageManager.getApplicationInfoAsUser(ApplicationPackageManager.java:539)
06-21 17:39:44.972  1100  3956 W System.err:    at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:492)
06-21 17:39:44.972  1100  3956 W System.err:    at com.android.server.wm.WindowState.<init>(WindowState.java:1384)
06-21 17:39:44.972  1100  3956 W System.err:    at com.android.server.wm.WindowState.<init>(WindowState.java:1165)
06-21 17:39:44.972  1100  3956 W System.err:    at com.android.server.wm.WindowManagerService.addWindow(WindowManagerService.java:1841)
06-21 17:39:44.972  1100  3956 W System.err:    at com.android.server.wm.Session.addToDisplayAsUser(Session.java:211)
06-21 17:39:44.972  1100  3956 W System.err:    at android.view.IWindowSession$Stub.onTransact(IWindowSession.java:691)
06-21 17:39:44.972  1100  3956 W System.err:    at com.android.server.wm.Session.onTransact(Session.java:176)
06-21 17:39:44.972  1100  3956 W System.err:    at android.os.Binder.execTransactInternal(Binder.java:1220)
06-21 17:39:44.972  1100  3956 W System.err:    at android.os.Binder.execTransact(Binder.java:1179)

I'll try to fix the crash but I believe it won't make the app work anyway if it can't connect to the network...

screenio5 commented 2 years ago

I remind you that when you leave the app ALSO outside knox (the secure folder), the app IN the secure folder never crashes and works fine. If you uninstall the app outside the secure folder, the app IN the secure folder keeps on working fine UNTIL you restart the phone. When you do, the app always crashes (as if something that existed outside the secure folder satisfied the inside secure folder app and when it gets removed it doesnt satisfies it any more)

Viish commented 2 years ago

It seems to me to be likely a bug in either Samsung KNOX feature given the particular scenario to reproduce the issue and the lack of information in the system logs.

I'll try to reproduce it on my device, but in the meantime do you have the same behavior (app can't access Internet) with any other app following the same process?

screenio5 commented 2 years ago

Absolutely not! Only Linphone crashes. Any other app (which needs and access internet) when moved into secure folder AND uninstalled outside the secure folder works fine (even after phone restarts). Please focus on the fact that when you DONT uninstall Linphone from outside secure folder, the instance IN the secure folder works always absolutely fine (even when you restart the phone). It is when you UNINSTALL from outside the secure folder and you restart the phone that Linphone begins to crash. In my opinion it is somehow related to some kind of file/directory requirement (which it doesnt find and therefore crashes).

In my opinion also you must enable secure folder and have a working phone/environment on your own in order to troubleshoot this.

Viish commented 2 years ago

Please focus on the fact that when you DONT uninstall Linphone from outside secure folder, the instance IN the secure folder works always absolutely fine (even when you restart the phone). It is when you UNINSTALL from outside the secure folder and you restart the phone that Linphone begins to crash.

Yes, I understood.

In my opinion it is somehow related to some kind of file/directory requirement (which it doesnt find and therefore crashes).

Not it's not. Linphone doesn't rely on much files, and given the logs from before the crash everything is fine from that point. The only real issue is why we aren't allowed to create sockets, and I'm quite sure this issue is out of our hands.

In my opinion also you must enable secure folder and have a working phone/environment on your own in order to troubleshoot this.

That we can agree on.

screenio5 commented 2 years ago

"The only real issue is why we aren't allowed to create sockets, and I'm quite sure this issue is out of our hands."

But if its a socket allowance issue, how can you explain the fact that when the outside secure folder linphone exists, the inside works fine? Theoretically, each instance does NOT see the other, therefore the inside knows nothing about the outside and whatever socket(s) the outside has created/creates should play no role for the inside one!

Furthermore, if KNOX did not allow socket creation I dont see how anything would work inside the secure folder. In previous versions of KNOX and Android Linphone worked fine in the secure folder. Something obviously has changed lately either in Android and/or KNOX but this seems to have an effect only in Linphone and none of any other apps I have tried (regardless of whether I keep the original instance outside secure folder or not).

Viish commented 2 years ago

I can confirm this is a KNOX issue as I don't reproduce this problem with my Samsung device (everything is up-to-date) following the same steps as you. So either you are not up-to-date and this issue has been fixed or this is an issue specific to your device.

screenio5 commented 2 years ago

Have you enabled secure folder? If yes, please let me know of the KNOX and Android version. Have you uninstalled the outside secure folder linphone? If yes, have you restarted the phone?

I can confirm that this happens on several phones, not only with the one in my hands.

Viish commented 2 years ago

Have you enabled secure folder? If yes, please let me know of the KNOX and Android version. Have you uninstalled the outside secure folder linphone? If yes, have you restarted the phone?

Yes I did all that, following your instructions... Please stop considering I'm a moron, I'm simply trying to help you and you're being a bit aggressive.

Know version is 3.8 (API level 35), secure folder version is 1.7.02.5, software version is One UI 4.1 (security patch from June 16 2022) Kernel 4.19.113-24299070

screenio5 commented 2 years ago

No no no!!! You misunderstood me! I thank you immensely for trying to help me out and I apologize if my tone of voice/texting was misunderstood

screenio5 commented 2 years ago

Know version is 3.8 (API level 35), secure folder version is 1.7.02.5, software version is One UI 4.1 (security patch from June 16 2022) Kernel 4.19.113-24299070

Hmmm, we have some discrepancies:

KNOX: same (3.8 (API level 35)) Secure folder: 1.7.01.67 (but says latest version is installed and there is no option to somehow upgrade it) One UI: 4.1 Kernel: 5.10.43

I also have everything updated. Which phone model is yours?

Viish commented 2 years ago

Which phone model is yours?

It's a Z Fold 2.

screenio5 commented 2 years ago

I just received a brand new A33 in its box. I will set it up from scratch, will not install anything else apart from Linphone and enable secure folder.

Viish commented 2 years ago

I can reproduce the crash on a Samsung Galaxy S10 with secure folder version 1.7.02.5 with KNOX 3.8 (API level 35) One UI 4.1 from May 2022. So maybe it has been fixed in June firmware update.

Viish commented 2 years ago

By the way I fixed the crash in DNS resolver, Linphone app still can't register (due to socket creation permission denial) and thus will be useless.

screenio5 commented 2 years ago

Can you please provide this special built so I try?

Viish commented 2 years ago

Here you go: https://download.linphone.org/snapshots/android/linphone-android-releaseWithCrashlytics-4.7.0-alpha.261+4a74a7585.apk

screenio5 commented 2 years ago

I tried the special built. App does not crash anymore (when instance outside secure folder has been uninstalled) BUT like you said. it fails to register on the SIP server. As soon as I installed the app outside the secure folder, the inside instance connected IMMEDIATELY! What I dont understand is how and why the outside is correlated with the inside one regarding the socket creation permission and why this didnt happen in previous Android/Knox versions.

Is there any workaround you might think of? I understand that if you need permissions and you are not granted there is obviously nothing you cant do, if for example you are granted the permissions some seconds later after the app has fully started?

Viish commented 2 years ago

What I dont understand is how and why the outside is correlated with the inside one regarding the socket creation permission and why this didnt happen in previous Android/Knox versions.

I don't understand it either, I believe this is merely a bug since it seems to have been fixed in latest firmware.

Is there any workaround you might think of? I understand that if you need permissions and you are not granted there is obviously nothing you cant do, if for example you are granted the permissions some seconds later after the app has fully started?

No there are not. INTERNET permission is automatically granted to the app the moment it is installed, it is not part of the permissions that have to be requested to the user.

screenio5 commented 2 years ago

I am a little bit confused. Please correct me if I got it wrong so far:

1) You have a Z Fold 2 with the following versions:

KNOX: 3.8 (API level 35) Secure folder: 1.7.02.5 One UI: 4.1 security patch from June 16 2022 Kernel: 4.19.113-24299070

In this phone Linphone never crashes and connects fine to SIP server (1st instance outside secure folder removed and phone has been restarted)

2) You also have a Galaxy S10 with:

KNOX: 3.8 (API level 35) Secure folder: 1.7.02.5 One UI: 4.1 from May 2022 Kernel: ?

In this phone Linphone crashes like mine

3) I have several A33 (and now I just setup a brand new one) which all have:

KNOX: 3.8 (API level 35) Secure folder: 1.7.01.67 One UI: 4.1 Kernel: 5.10.43

All ofc crash.

The only apparent difference -like you mentioned- is the "June 16" update which is not available for my A33 phones (and I assume also yours).

Furthermore, what confuses me totally is this:

1) I install Linphone and then add it to secure folder. In secure folder I setup a SIP account and it connects 2) I restart the phone. Linphone inside secure folder still works fine 3) I remove Linphone from outside secure folder. Inside still works fine 4) Restart the phone. Inside does not connect to sip server anymore (here it would crash) 5) I install Linphone outside and I dont touch it! (not even open it) 6) I go into the Linphone inside secure folder and now it has connected to the sip server!!!!

I fail to understand why the presence -and only the presence- of the app outside secure folder allows the inside one to create sockets and resolve dns names. I am totally baffled

Viish commented 2 years ago

Please correct me if I got it wrong so far

You are right. The device that crashes in on May 2022 security patch, the one that works fine is on June 2022 security patch.

I fail to understand why the presence -and only the presence- of the app outside secure folder allows the inside one to create sockets and resolve dns names. I am totally baffled

You don't have to understand as there is probably no other correlation than a bug in how KNOX & secure folder work. For example it might simply be that the system no longer as access to the app's Manifest and thus doesn't grant the INTERNET permission or something like that. You may want to send this feedback to Samsung if there is a way to notify them of issues in their softwares/firmwares.