-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Android API 23, Runtime Crash in .NET 9 #106025
Comments
Tagging subscribers to this area: @dotnet/area-system-runtime |
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 |
Tagging subscribers to 'arch-android': @vitek-karas, @simonrozsival, @steveisok, @akoeplinger |
@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:
But earlier in the log:
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 @steveisok @akoeplinger does Mono log the |
No, looks like we don't do anything with the error: runtime/src/mono/mono/utils/mono-dl.c Lines 269 to 271 in dec4568
|
@grendello isn't that the real error? sounds weird though
|
@akoeplinger on one hand yes, it is, on the other... how do we even run the app if |
Can't reproduce this. Tried running on my apple chip with arm64 AVD, failed to reproduce, then noticed that in the report the device was android-x86. I then tried the following:
|
Our nightly CI is failing, because we dropped 32-bit by default:
Let me fix these tests and find out if latest is working. |
Fixing our tests here: This should find out if this is still an issue with recent-ish RC 2. |
@BrzVlad I think I'm still seeing that
It looks like this works on API 21 and fails on API 23? And then x86 is the only emulator option for those old Android versions. |
@jonathanpeppers / @steveisok -- Checking in on this. Does it still need resolution before .NET 9 GA? If so, who should be assigned to bring it to closure? |
It looks like this combination isn't working:
So, it's unknown how impacting this will be for customers. It's hard to know if you would see the same thing on arm64 devices. |
@jonathanpeppers -- @tannergooding pointed out that API 23 and older appear to be completely out of support by Google now. See https://developer.android.com/google/play/requirements/target-sdk:
I'm inclined to close this out based on that info. What do you think? |
Notably I'm not sure its "completely out of support" but rather that it isn't supported if you're wanting to target the "latest devices". There's still reasons to target downlevel API levels to support some older devices, but there's an overall balance required and I don't think an official page for what versions are supported across devices still exist. |
The “target” is what API you compiled against, Google Play requires very recent for this. “Minimum” API level is what you can run on. .NET has a minimum of API 21. |
Based on @BrzVlad's previous analysis, are we sure this is a runtime issue? |
We are checking if a newer version of the API 23 emulator solves it: Does something test "hello world" on Android on an API 23 (or 21) emulator? Is there a Helix lane for this? If you have that running somewhere, and it would load |
There are Helix queues with 21/23 emulators, |
@matouskozak if one of those is succeeding with latest .NET 9 builds we can close this. If you can find a build, would there be a log message saying |
Does this issue need Android SDK to reproduce? If so, I think we don't run any tests with the dotnet/android code inside runtime. We did run a .NET 9 runtime validation on Android API 21 - 32 (#106951) and I don't recall any issues with loading @jonathanpeppers if there is a repro only using dotnet/runtime I can setup a PR with older Android emulators to test it. Or if dotnet/android can use Helix we could open the PR there. |
After more investigation, we think this is some kind of bug in the x86, API 23 emulator image. API 21 is also working on our same pipeline, so this covers our minimum supported devices. API 23 was when Android first introduced some changes to loading native libraries, and its likely buggy. We can close this, as we don't think it's a runtime issue. There is some conversation on discord here for details: |
Context: dotnet/runtime#106025 Context: https://discord.com/channels/732297728826277939/732297837953679412/1296764055654240317 `Mono.Android-Tests` on API 23 crash on launch with: 09-17 14:41:32.839 2758 2758 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" But this same library appears to be correct, and loads on all of: * x86 API 21 * x86_64 API 23 * x86 API 24 This leads us to believe there is some kind of bug with loading native libraries on the API 23 x86 emulator image. For now, let's just target x86_64 on API 23 for the time being.
Context: dotnet/runtime#106025 Context: https://discord.com/channels/732297728826277939/732297837953679412/1296764055654240317 `Mono.Android-Tests` on API 23 crash on launch with: 09-17 14:41:32.839 2758 2758 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" But this same library appears to be correct, and loads on all of: * x86 API 21 * x86_64 API 23 * x86 API 24 This leads us to believe there is some kind of bug with loading native libraries on the API 23 x86 emulator image. For now, let's just target x86_64 on API 23 for the time being.
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
The text was updated successfully, but these errors were encountered: