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

Xamarin iOS Simulator tests throw System.Reflection.TargetException #153

Closed
AddressXception opened this issue Feb 19, 2021 · 2 comments
Closed
Labels
bug Something isn't working hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed

Comments

@AddressXception
Copy link
Collaborator

AddressXception commented Feb 19, 2021

Bug Report

Current Behavior
When running the C# tests in the ios simulator test harness sometimes the tests will fail to execute properly due to a reflection error. This is likely caused by a misalignment of pointer references when the garbage collector runs. This bug was introduced as part of #152 and #154 when the safe handle was added. It is likely that the safe handle is either freeing resources it should not free or is not freeing resources that it should.

Expected Behavior
The tests should be able to be run multiple times in any order with consistent results.

  1. fire up the simulator and run the tests
  2. poke around running tests individually for a while
  3. expected: all tests pass always
  4. actual: eventually you'll hi the stack trace below

Environment

  • OS: OSX, IPhone Simulator
  • Version: Big Sur on x64

Possible Solution

Additional context/Screenshots
Trace:

TestBallot
2021-02-19 10:53:56.417720-0500 ElectionGuard.Tests.iOS[18485:1575001] 	[FAIL] TestBallot.Test_Ballot_Property_Getters : System.Reflection.TargetException : Object does not match target type.
2021-02-19 10:53:56.417887-0500 ElectionGuard.Tests.iOS[18485:1575001] 		  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00024] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:376
2021-02-19 10:53:56.418028-0500 ElectionGuard.Tests.iOS[18485:1575001] 		  at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/external/corefx/src/Common/src/CoreLib/System/Reflection/MethodBase.cs:53
2021-02-19 10:53:56.418156-0500 ElectionGuard.Tests.iOS[18485:1575001] 		  at NUnit.Framework.Internal.Reflect.InvokeMethod (System.Reflection.MethodInfo method, System.Object fixture, System.Object[] args) [0x00009] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/builds/downloads/ios-release-Darwin-5e9cb6d1c1de430965312927d5aed7fcb27bfa73/ios-sources/external/nunit-lite/NUnitLite-1.0.0/src/framework/Internal/Reflect.cs:215
2021-02-19 10:53:56.418557-0500 ElectionGuard.Tests.iOS[18485:1575001] 	[FAIL] TestBallot.Test_Plaintext_Ballot_Selection_Is_InValid_With_Different_objectIds : System.Reflection.TargetException : Object does not match target type.
@AddressXception AddressXception added this to the Ada Lovelace 1.0.0 milestone Feb 19, 2021
@AddressXception AddressXception added the bug Something isn't working label Feb 19, 2021
@lmarie79 lmarie79 added hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed labels Sep 20, 2021
@XinyiXiang
Copy link

Please assign this to me

@keithrfung
Copy link
Collaborator

@XinyiXiang This issue is no longer relevant. See #195

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hacktoberfest Issues for the Hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants