Skip to content

MonoTests.System.Reflection.Emit.SaveTest.Save test fails in Release configuration with BCL linking on #1186

@grendello

Description

@grendello

A test from the Mono BCL test suite (MonoTests.System.Reflection.Emit.SaveTest.Save) fails when the tests are built in Release mode with linking set to SdkOnly.
It seems that the linker somehow changes the order of interfaces in emitted code since turning BCL linking off makes the test work again. The test also works fine in Debug configuration (with the linker off)

Steps to Reproduce

  1. Comment out this line
  2. Run make CONFIGURATION=Release run-apk-tests from the top Xamarin.Android dir
  3. Wait patiently
  4. Find the failure in the NUnit tests result file (TestResult-Xamarin.Android.Bcl_Tests.nunit-Release.xml in the top Xamarin.Android directory)

Expected Behavior

The test should run fine with BCL linking on

Actual Behavior

The test fails when executed with BCL linking on

Version Information

Xamarin.Android/master (c4e81655ac22b06806e732e9dd0bc729e8d2c1d7)

Test failure

MESSAGE:
  Expected: <iface1>
  But was:  <System.IComparable>

  +++++++++++++++++++
  STACK TRACE:
  at MonoTests.System.Reflection.Emit.SaveTest.CheckAssembly (System.Reflection.Assembly a) [0x000a0] in <1e30aff9165c427db5bedc42c5906861>:0 
  at MonoTests.System.Reflection.Emit.SaveTest.Save () [0x00b6d] in <1e30aff9165c427db5bedc42c5906861>:0 
  at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00032] in <0a3e31ed05774b07957e0b91c5cab789>:0

Metadata

Metadata

Assignees

Labels

Area: LinkerIssues when linking assemblies.bugComponent does not function as intended.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions