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

[Mono][Android][Test] Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform. #54905

Open
Tracked by #44661
fanyang-mono opened this issue Jun 29, 2021 · 6 comments
Labels
area-Interop-mono disabled-test The test is disabled in source code against the issue os-android
Milestone

Comments

@fanyang-mono
Copy link
Member

fanyang-mono commented Jun 29, 2021

Failed tests list:

  • Interop/NativeLibrary/API/NativeLibraryTests/NativeLibraryTests.sh
  • Interop/NativeLibrary/Callback/CallbackStressTest_TargetUnix/CallbackStressTest_TargetUnix.sh

Full log

      06-21 22:19:56.080  3815  3832 I DOTNET  : MonoRunner initialize,, entryPointLibName=NativeLibraryTests.dll
      06-21 22:19:56.080  3815  3832 D DOTNET  : file_path: /data/user/0/net.dot.Interop_NativeLibrary/files/runtimeconfig.bin
      06-21 22:19:56.082  3815  3832 D DOTNET  : assembly_preload_hook: System.Private.CoreLib (null) /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: NativeLibraryTests.dll (null) /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : Executable: NativeLibraryTests.dll
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: System.Runtime  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: System.Runtime.InteropServices  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: TestLibrary  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.102  3815  3832 D DOTNET  : assembly_preload_hook: System.Console  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.179  3815  3832 E mono    : 
      06-21 22:19:56.179  3815  3832 E mono    : Unhandled Exception:
      06-21 22:19:56.179  3815  3832 E mono    : System.PlatformNotSupportedException: Operation is not supported on this platform.
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryToLoad.GetFileName() in NativeLibraryTests.dll:token 0x600000d+0x27
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryToLoad.GetFullPath() in NativeLibraryTests.dll:token 0x600000e+0x12
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryTest.Main() in NativeLibraryTests.dll:token 0x6000001+0x14
      06-21 22:19:56.179  3815  3832 E DOTNET  : UnhandledException: System.PlatformNotSupportedException Operation is not supported on this platform.    at NativeLibraryToLoad.GetFileName() in NativeLibraryTests.dll:token 0x600000d+0x27
      06-21 22:19:56.179  3815  3832 E DOTNET  :    at NativeLibraryToLoad.GetFullPath() in NativeLibraryTests.dll:token 0x600000e+0x12
      06-21 22:19:56.179  3815  3832 E DOTNET  :    at NativeLibraryTest.Main() in NativeLibraryTests.dll:token 0x6000001+0x14
      06-21 22:19:56.215  1792  3093 I ActivityManager: Process net.dot.Interop_NativeLibrary (pid 3815) has died: fore FGS 
      06-21 22:19:56.215  1792  3093 W ActivityManager: Crash of app net.dot.Interop_NativeLibrary running instrumentation ComponentInfo{net.dot.Interop_NativeLibrary/net.dot.MonoRunner}
      06-21 22:19:56.215  1792  3093 I ActivityManager: Force stopping net.dot.Interop_NativeLibrary appid=10158 user=0: finished inst
      06-21 22:19:56.217  1535  1535 I Zygote  : Process 3815 exited cleanly (1)
      06-21 22:19:56.217  1792  3835 W Binder  : Outgoing transactions from this process must be FLAG_ONEWAY
      06-21 22:19:56.217  1792  3835 W Binder  : java.lang.Throwable
      06-21 22:19:56.217  1792  3835 W Binder  : 	at android.os.BinderProxy.transact(BinderProxy.java:480)
      06-21 22:19:56.217  1792  3835 W Binder  : 	at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:205)
      06-21 22:19:56.217  1792  3835 W Binder  : 	at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
      06-21 22:19:56.218  3804  3804 D AndroidRuntime: Shutting down VM
      06-21 22:19:56.260  1792  1819 I libprocessgroup: Successfully killed process cgroup uid 10158 pid 3815 in 44ms
@fanyang-mono fanyang-mono added this to the 6.0.0 milestone Jun 29, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jun 29, 2021
@ghost
Copy link

ghost commented Jun 29, 2021

Tagging subscribers to 'arch-android': @steveisok, @akoeplinger
See info in area-owners.md if you want to be subscribed.

Issue Details

Failed test list:

  • Interop/NativeLibrary/API/NativeLibraryTests/NativeLibraryTests.sh
  • Interop/NativeLibrary/Callback/CallbackStressTest_TargetUnix/CallbackStressTest_TargetUnix.sh
      06-21 22:19:56.080  3815  3832 I DOTNET  : MonoRunner initialize,, entryPointLibName=NativeLibraryTests.dll
      06-21 22:19:56.080  3815  3832 D DOTNET  : file_path: /data/user/0/net.dot.Interop_NativeLibrary/files/runtimeconfig.bin
      06-21 22:19:56.082  3815  3832 D DOTNET  : assembly_preload_hook: System.Private.CoreLib (null) /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: NativeLibraryTests.dll (null) /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : Executable: NativeLibraryTests.dll
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: System.Runtime  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: System.Runtime.InteropServices  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.101  3815  3832 D DOTNET  : assembly_preload_hook: TestLibrary  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.102  3815  3832 D DOTNET  : assembly_preload_hook: System.Console  /data/user/0/net.dot.Interop_NativeLibrary/files
      06-21 22:19:56.179  3815  3832 E mono    : 
      06-21 22:19:56.179  3815  3832 E mono    : Unhandled Exception:
      06-21 22:19:56.179  3815  3832 E mono    : System.PlatformNotSupportedException: Operation is not supported on this platform.
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryToLoad.GetFileName() in NativeLibraryTests.dll:token 0x600000d+0x27
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryToLoad.GetFullPath() in NativeLibraryTests.dll:token 0x600000e+0x12
      06-21 22:19:56.179  3815  3832 E mono    :    at NativeLibraryTest.Main() in NativeLibraryTests.dll:token 0x6000001+0x14
      06-21 22:19:56.179  3815  3832 E DOTNET  : UnhandledException: System.PlatformNotSupportedException Operation is not supported on this platform.    at NativeLibraryToLoad.GetFileName() in NativeLibraryTests.dll:token 0x600000d+0x27
      06-21 22:19:56.179  3815  3832 E DOTNET  :    at NativeLibraryToLoad.GetFullPath() in NativeLibraryTests.dll:token 0x600000e+0x12
      06-21 22:19:56.179  3815  3832 E DOTNET  :    at NativeLibraryTest.Main() in NativeLibraryTests.dll:token 0x6000001+0x14
      06-21 22:19:56.215  1792  3093 I ActivityManager: Process net.dot.Interop_NativeLibrary (pid 3815) has died: fore FGS 
      06-21 22:19:56.215  1792  3093 W ActivityManager: Crash of app net.dot.Interop_NativeLibrary running instrumentation ComponentInfo{net.dot.Interop_NativeLibrary/net.dot.MonoRunner}
      06-21 22:19:56.215  1792  3093 I ActivityManager: Force stopping net.dot.Interop_NativeLibrary appid=10158 user=0: finished inst
      06-21 22:19:56.217  1535  1535 I Zygote  : Process 3815 exited cleanly (1)
      06-21 22:19:56.217  1792  3835 W Binder  : Outgoing transactions from this process must be FLAG_ONEWAY
      06-21 22:19:56.217  1792  3835 W Binder  : java.lang.Throwable
      06-21 22:19:56.217  1792  3835 W Binder  : 	at android.os.BinderProxy.transact(BinderProxy.java:480)
      06-21 22:19:56.217  1792  3835 W Binder  : 	at android.app.IInstrumentationWatcher$Stub$Proxy.instrumentationFinished(IInstrumentationWatcher.java:205)
      06-21 22:19:56.217  1792  3835 W Binder  : 	at com.android.server.am.InstrumentationReporter$MyThread.run(InstrumentationReporter.java:86)
      06-21 22:19:56.218  3804  3804 D AndroidRuntime: Shutting down VM
      06-21 22:19:56.260  1792  1819 I libprocessgroup: Successfully killed process cgroup uid 10158 pid 3815 in 44ms
Author: fanyang-mono
Assignees: -
Labels:

area-Interop-mono, os-android

Milestone: 6.0.0

@fanyang-mono fanyang-mono removed the untriaged New issue has not been triaged by the area owner label Jun 29, 2021
@steveisok
Copy link
Member

@fanyang-mono I believe there needs to be an additional OS check added

public static string GetFileName()
{
if (OperatingSystem.IsWindows())
return $"{Name}.dll";
if (OperatingSystem.IsLinux())
return $"lib{Name}.so";
if (OperatingSystem.IsMacOS())
return $"lib{Name}.dylib";
throw new PlatformNotSupportedException();
}

@fanyang-mono fanyang-mono changed the title [Mono][Android][Interop] Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform. [Mono][Android][Test] Unhandled Exception: System.PlatformNotSupportedException: Operation is not supported on this platform. Jun 29, 2021
@fanyang-mono
Copy link
Member Author

fanyang-mono commented Jul 15, 2021

Tests didn't pass after adding an Android switch to NativeLibraryToLoad.cs. There are more work to be done, in order to make the tests pass.

  1. Make runtime tests native build work for Android
    https://github.com/dotnet/runtime/blob/main/src/tests/build.sh#L265-L266
  2. Include the generated native libraries (.so files) in the Android app. For Xamarin.Android, build action AndroidNativeLibrary needs to be used.
    https://github.com/xamarin/xamarin-android/blob/681887ebdbd192ce7ce1cd02221d4939599ba762/tests/CodeGen-Binding/Xamarin.Android.JcwGen-Tests/Xamarin.Android.JcwGen-Tests.csproj#L82-L87

@fanyang-mono fanyang-mono modified the milestones: 6.0.0, 7.0.0 Jul 15, 2021
@steveisok
Copy link
Member

@fanyang-mono Is this still an issue?

@fanyang-mono fanyang-mono modified the milestones: 7.0.0, 8.0.0 Aug 2, 2022
@fanyang-mono
Copy link
Member Author

Moving to 8.0.0

@fanyang-mono
Copy link
Member Author

Moving to 9.0.0

@fanyang-mono fanyang-mono modified the milestones: 8.0.0, 9.0.0 Jul 17, 2023
@vitek-karas vitek-karas added the disabled-test The test is disabled in source code against the issue label Jul 19, 2024
@fanyang-mono fanyang-mono removed their assignment Jul 26, 2024
@vitek-karas vitek-karas modified the milestones: 9.0.0, 10.0.0 Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Interop-mono disabled-test The test is disabled in source code against the issue os-android
Projects
Status: No status
Development

No branches or pull requests

3 participants