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

Android on-device tests that fail under LLVM #89190

Open
jonathanpeppers opened this issue Jul 19, 2023 · 6 comments
Open

Android on-device tests that fail under LLVM #89190

jonathanpeppers opened this issue Jul 19, 2023 · 6 comments

Comments

@jonathanpeppers
Copy link
Member

Description

We have a set of on-device tests that only fail when building with -p:EnableLLVM=true.

Error message
Expected: True
But was:  False
Stack trace
   at Java.InteropTests.JniValueMarshalerContractTests`1[[System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].CreateValue()
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , IntPtr* )
   at System.Reflection.MethodInvoker.Invoke(Object , IntPtr* , BindingFlags )

Example:

They only fail on bool, sbyte, char, and short. The tests pass if -p:EnableLLVM is false (which is the default for customers) and they pass for the other data types.

Reproduction Steps

Build and run the xamarin/xamarin-android device test project with -c Release -p:EnableLLVM=true:

Expected behavior

Tests pass when -p:EnableLLVM=true.

Actual behavior

Tests fail when -p:EnableLLVM=true.

Regression?

Yes, this worked in .NET 6 & .NET 7 and past .NET 8 previews.

Known Workarounds

Use -p:EnableLLVM=false instead.

Configuration

Started happening: dotnet/android#8176

.NET SDK: 8.0.100-preview.7.23364.32

Other information

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 19, 2023
jonathanpeppers added a commit to dotnet/java-interop that referenced this issue Jul 19, 2023
@jonathanpeppers jonathanpeppers added area-Codegen-AOT-mono and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Jul 19, 2023
@akoeplinger akoeplinger added this to the 8.0.0 milestone Jul 19, 2023
@akoeplinger
Copy link
Member

/cc @vargaz

jonathanpeppers added a commit to dotnet/java-interop that referenced this issue Jul 19, 2023
@vargaz
Copy link
Contributor

vargaz commented Jul 20, 2023

Would it be possible to create a smaller testcase that doesn't depend on xamarin-android ? Or the functionality is android specific ?

jonathanpeppers added a commit to dotnet/android that referenced this issue Jul 20, 2023
Changes: dotnet/installer@28d4a6b...ca467d6
Changes: dotnet/runtime@3e87528...ae99bb2
Changes: dotnet/emsdk@60a73f9...afbff08
Changes: dotnet/cecil@3e46711...1a6a83a

Updates:

* Microsoft.Dotnet.Sdk.Internal: from 8.0.100-preview.7.23330.16 to 8.0.100-preview.7.23364.32
* Microsoft.NETCore.App.Ref: from 8.0.0-preview.7.23329.8 to 8.0.0-preview.7.23364.3
* Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport: from 8.0.0-preview.7.23326.1 to 8.0.0-preview.7.23361.2
* Microsoft.NET.ILLink.Tasks: from 8.0.0-preview.7.23329.8 to 8.0.0-preview.7.23364.3
* Microsoft.DotNet.Cecil: from 0.11.4-alpha.23327.1 to 0.11.4-alpha.23360.2

~~ Other changes ~~

* Update `.apkdesc` files for app size changes

* Ignore several tests around an LLVM build issue on Windows:

dotnet/runtime#88625

* Workarounds for behavior changes around `$DOTNET_ROOT`:

This appears to be the way to get `<Csc/>` to pick the right `dotnet`:

https://github.com/dotnet/roslyn/pull/68918/files#diff-ec99cd9453fe657dd1ea08e93e94b0bb51c51484b8ad25882d312564e5fe8e26R61

* [tests] disable failing Java.Interop tests under LLVM

dotnet/runtime#89190

* Bump to xamarin/java.interop/main@62efc0980

Changes: dotnet/java-interop@151b03e...62efc09

Co-authored-by: Jonathan Peppers <jonathan.peppers@microsoft.com>
@jonathanpeppers
Copy link
Member Author

Maybe @jonpryor would know how to do this when he's back.

I'm guessing this would be something like:

  • Console app running on macOS
  • Mono runtime
  • Bring in some amount of code from java.interop

But then you'd have to setup the <MonoAOTCompiler/> task w/ LLVM?

I don't see the required AOT pack to make this kind of project:

https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet8/NuGet/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.maccatalyst-arm64/overview/8.0.0-preview.7.23369.13

I think we would need Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.osx-arm64 to do this on an M1, which doesn't exist?

Maybe the only way to do this is on Android.

@SamMonoRT
Copy link
Member

cc @fanyang-mono

jonpryor pushed a commit to dotnet/android that referenced this issue Jul 31, 2023
Context: dotnet/runtime#89190
Context: #8176

Changes: dotnet/java-interop@151b03e...62efc09

  * dotnet/java-interop@62efc098: [tests] add category for tests that fail under LLVM (dotnet/java-interop#1131)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@vargaz
Copy link
Contributor

vargaz commented Aug 5, 2023

Tried extracting a testcase out of the test suite into a standalone app, but can't reproduce the problem.

@fanyang-mono fanyang-mono self-assigned this Aug 16, 2023
@SamMonoRT
Copy link
Member

This seems like a test case failure. Moving to 9.0.0, but based on ongoing investigations, if needed will backport fix to 8.0\rc1

@SamMonoRT SamMonoRT modified the milestones: 8.0.0, 9.0.0 Aug 18, 2023
@steveisok steveisok modified the milestones: 9.0.0, Future Jun 28, 2024
@fanyang-mono fanyang-mono removed their assignment Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants