Open jonathanpeppers opened 1 month ago
Tagging subscribers to this area: @dotnet/area-system-runtime See info in area-owners.md if you want to be subscribed.
This looks like two issues in one: it's trying to throw an exception but then crashes because of the nested exception.
Tagging subscribers to this area: @dotnet/area-system-runtime See info in area-owners.md if you want to be subscribed.
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger See info in area-owners.md if you want to be subscribed.
@jonathanpeppers from the logcat, it appears libSystem.Native could not be loaded. Is there something wrong with your setup?
@grendello do you know what might cause:
08-06 03:33:11.720 2745 2745 D monodroid-assembly: monodroid_dlopen: hash for name 'libSystem.Native' is 0x5b9ade60
08-06 03:33:11.721 2745 2745 D monodroid-assembly: monodroid_dlopen: hash match found, DSO name is 'libSystem.Native.so'
08-06 03:33:11.723 2745 2745 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native.so'
08-06 03:33:11.732 2745 2745 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native.so'. dlopen failed: library "/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native.so" not found
08-06 03:33:11.732 2745 2745 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/libSystem.Native.so'
08-06 03:33:11.735 2745 2745 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/libSystem.Native.so'. dlopen failed: cannot find "libc.so" from verneed[1] in DT_NEEDED list for "/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk"
08-06 03:33:11.736 2745 2745 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native'
08-06 03:33:11.736 2745 2745 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native'. dlopen failed: library "/data/app/Mono.Android.NET_Tests-1/base.apk!/lib/x86/libSystem.Native" not found
08-06 03:33:11.737 2745 2745 I monodroid-assembly: Trying to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/libSystem.Native'
08-06 03:33:11.737 2745 2745 I monodroid-assembly: Failed to load shared library '/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/libSystem.Native'. dlopen failed: library "/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk!/lib/x86/libSystem.Native" not found
08-06 03:33:11.738 2745 2745 W monodroid-assembly: Shared library 'libSystem.Native' not loaded, p/invoke 'SystemNative_SchedGetCpu' may fail
08-06 03:33:11.738 2745 2745 F monodroid-assembly: Failed to load symbol 'SystemNative_SchedGetCpu' from shared library 'libSystem.Native'
But earlier in the log:
08-06 03:33:11.008 2745 2745 D monodroid-assembly: /data/app/Mono.Android.NET_Tests-1/split_config.x86.apk entry: lib/x86/libSystem.Native.so
08-06 03:33:11.008 2745 2745 D monodroid-assembly: ZIP: local header offset: 921492; data offset: 933888; file size: 96760
08-06 03:33:11.008 2745 2745 D monodroid-assembly: Found a shared library entry lib/x86/libSystem.Native.so (index: 2; name: libSystem.Native.so; hash: 0x79d6a0ba; apk offset: 0)
This is a 32-bit emulator, could this be fallout of the 16k alignment changes?
@jonathanpeppers 32-bit shared libraries are aligned to 4k, 16k applies only to 64-bit targets. That's what NDK r27 does, so I followed suit, but it might be still a system error. We store the dlerror
message when loading the shared library and pass it back to Mono via the dlopen hook here.
@steveisok @akoeplinger does Mono log the err
when it sees one?
No, looks like we don't do anything with the error: https://github.com/dotnet/runtime/blob/dec456802525f73944de05a59c4b7db7d67b4a8a/src/mono/mono/utils/mono-dl.c#L269-L271
@grendello isn't that the real error? sounds weird though
dlopen failed: cannot find "libc.so" from verneed[1] in DT_NEEDED list for "/data/app/Mono.Android.NET_Tests-1/split_config.x86.apk"
@akoeplinger on one hand yes, it is, on the other... how do we even run the app if libc.so
cannot be found? :) Just doesn't make sense
Description
We have a nightly test pipeline that runs our test suite on older Android emulators.
The API 23 emulator crashes at runtime with:
This appears to be working fine on newer API levels.
Reproduction Steps
Run this test project on an API 23 emulator:
Expected behavior
Our test suite passes on API 23 emulators.
Actual behavior
Our test suite crashes on API 23 emulators.
Regression?
Yes, this is working in .NET 8.
Known Workarounds
n/a
Configuration
Noticed with:
I think this was also happening in .NET 9 Preview 7 builds.
Other information
logcat-Release23-Mono.Android.NET_Tests.txt