-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
We have a test in xamarin-android that compares network interface information obtained from mono vs java that is producing inconsistent results. When this test runs on an x86_64 emulator without AOT+LLVM enabled it passes, but when LLVM is enabled it fails. I have trimmed this down to a smaller repro project that I have attached. The problematic code appears to be as follows:
foreach (var inf in NetworkInterface.GetAllNetworkInterfaces ()) {
byte[] bytes = inf.GetPhysicalAddress ().GetAddressBytes ();
if (bytes.All (x => x == 0)) {
// Condition is true for interfaces with physical addresses when LLVM is enabled, and false when LLVM is disabled
}
}Reproduction Steps
-
Build xamarin-android/main, or install the workload packs produced by a recent build from CI.
-
Download the DroidTestIface.zip repro project and run it on an x86_64 emulator:
dotnet build DroidTestIface.csproj -v:n -c Release -p:EnableLlvm=true -p:AndroidEnableProfiledAot=false
- After installation open the app on the emulator and tap the button.
Expected behavior
When building in debug without AOT/LLVM enabled, I see that a couple of network interfaces with physical addresses will return false when checking if their physical address bytes are all zero.
Actual behavior
When building with AOT/LLVM enabled, I see that the network interfaces that had physical addresses will return true when checking if their physical address bytes are all zero.
Regression?
No response
Known Workarounds
No response
Configuration
This issue is present when running on an an Android x86_64 emulator, using an Android SDK built against the following:
<Dependency Name="Microsoft.Dotnet.Sdk.Internal" Version="7.0.100-rc.2.22426.5">
<Uri>https://github.com/dotnet/installer</Uri>
<Sha>2d1a4de6b2da59647a9538bf9cc4e252847e6231</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App.Ref" Version="7.0.0-rc.1.22422.12" CoherentParentDependency="Microsoft.Dotnet.Sdk.Internal">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>ef077d0b58ffddcf54fa73bd85dace6b999b8992</Sha>
</Dependency>Other information
No response