Skip to content

[tools] Fix class_ptr rewriter to patch exception handlers too when instructions change. - #22565

Merged
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/rewriter-handle-exception-clauses
Apr 7, 2025
Merged

[tools] Fix class_ptr rewriter to patch exception handlers too when instructions change.#22565
rolfbjarne merged 1 commit into
mainfrom
dev/rolf/rewriter-handle-exception-clauses

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Fixes these test failures when running a release build with all optimizations and the static registrar:

MonoTouchFixtures.AppKit.NSGridViewTest
	[FAIL] CreateWithNSViewArrayOfArrayCheckDifferentArrayLength : System.InvalidProgramException : InvalidProgram_Default
		   at AppKit.NSGridView.Create(NSView[][])
		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckDifferentArrayLength()
		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
	[FAIL] CreateWithNSViewArrayOfArrayCheckNSTextView : System.InvalidProgramException : InvalidProgram_Default
		   at AppKit.NSGridView.Create(NSView[][])
		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckNSTextView()
		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNull :   Broken Array #3
  Expected: <System.ArgumentNullException>
  But was:  <System.InvalidProgramException: InvalidProgram_Default
   at AppKit.NSGridView.Create(NSView[][])
   at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass6_0.<CreateWithNSViewArrayOfArrayCheckWithNull>b__0()
   at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNull()
	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullArray :   Broken Array #2
  Expected: <System.ArgumentNullException>
  But was:  <System.InvalidProgramException: InvalidProgram_Default
   at AppKit.NSGridView.Create(NSView[][])
   at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass5_0.<CreateWithNSViewArrayOfArrayCheckWithNullArray>b__0()
   at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullArray()
	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullNSView :   Broken Array #1
  Expected: <System.ArgumentNullException>
  But was:  <System.InvalidProgramException: InvalidProgram_Default
   at AppKit.NSGridView.Create(NSView[][])
   at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass4_0.<CreateWithNSViewArrayOfArrayCheckWithNullNSView>b__0()
   at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullNSView()
	[FAIL] CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize : System.InvalidProgramException : InvalidProgram_Default
		   at AppKit.NSGridView.Create(NSView[,])
		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize()
		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
	[FAIL] CreateWithTwoDimensionalNSViewArrayCheckWithNull :   Broken Array #4
  Expected: <System.ArgumentNullException>
  But was:  <System.InvalidProgramException: InvalidProgram_Default
   at AppKit.NSGridView.Create(NSView[,])
   at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass7_0.<CreateWithTwoDimensionalNSViewArrayCheckWithNull>b__0()
   at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckWithNull()
	[FAIL] CreateWithTwoDimensionalNSViewArrayNSTextView : System.InvalidProgramException : InvalidProgram_Default
		   at AppKit.NSGridView.Create(NSView[,])
		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayNSTextView()
		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
	[FAIL] CreateWithTwoDimensionalNSViewArrayWithNullCell :   Broken Array #5
  Expected: <System.ArgumentNullException>
  But was:  <System.InvalidProgramException: InvalidProgram_Default
   at AppKit.NSGridView.Create(NSView[,])
   at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass8_0.<CreateWithTwoDimensionalNSViewArrayWithNullCell>b__0()
   at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayWithNullCell()

…nstructions change.

Fixes these test failures when running a release build with all optimizations and the static registrar:

    MonoTouchFixtures.AppKit.NSGridViewTest
    	[FAIL] CreateWithNSViewArrayOfArrayCheckDifferentArrayLength : System.InvalidProgramException : InvalidProgram_Default
    		   at AppKit.NSGridView.Create(NSView[][])
    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckDifferentArrayLength()
    		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
    		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
    	[FAIL] CreateWithNSViewArrayOfArrayCheckNSTextView : System.InvalidProgramException : InvalidProgram_Default
    		   at AppKit.NSGridView.Create(NSView[][])
    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckNSTextView()
    		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
    		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
    	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNull :   Broken Array #3
      Expected: <System.ArgumentNullException>
      But was:  <System.InvalidProgramException: InvalidProgram_Default
       at AppKit.NSGridView.Create(NSView[][])
       at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass6_0.<CreateWithNSViewArrayOfArrayCheckWithNull>b__0()
       at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNull()
    	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullArray :   Broken Array #2
      Expected: <System.ArgumentNullException>
      But was:  <System.InvalidProgramException: InvalidProgram_Default
       at AppKit.NSGridView.Create(NSView[][])
       at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass5_0.<CreateWithNSViewArrayOfArrayCheckWithNullArray>b__0()
       at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullArray()
    	[FAIL] CreateWithNSViewArrayOfArrayCheckWithNullNSView :   Broken Array #1
      Expected: <System.ArgumentNullException>
      But was:  <System.InvalidProgramException: InvalidProgram_Default
       at AppKit.NSGridView.Create(NSView[][])
       at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass4_0.<CreateWithNSViewArrayOfArrayCheckWithNullNSView>b__0()
       at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithNSViewArrayOfArrayCheckWithNullNSView()
    	[FAIL] CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize : System.InvalidProgramException : InvalidProgram_Default
    		   at AppKit.NSGridView.Create(NSView[,])
    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckDifferentDimensionSize()
    		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
    		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
    	[FAIL] CreateWithTwoDimensionalNSViewArrayCheckWithNull :   Broken Array #4
      Expected: <System.ArgumentNullException>
      But was:  <System.InvalidProgramException: InvalidProgram_Default
       at AppKit.NSGridView.Create(NSView[,])
       at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass7_0.<CreateWithTwoDimensionalNSViewArrayCheckWithNull>b__0()
       at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayCheckWithNull()
    	[FAIL] CreateWithTwoDimensionalNSViewArrayNSTextView : System.InvalidProgramException : InvalidProgram_Default
    		   at AppKit.NSGridView.Create(NSView[,])
    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayNSTextView()
    		   at System.RuntimeMethodHandle.InvokeMethod(Object, Void**, Signature, Boolean)
    		   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
    		   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object, BindingFlags)
    	[FAIL] CreateWithTwoDimensionalNSViewArrayWithNullCell :   Broken Array #5
      Expected: <System.ArgumentNullException>
      But was:  <System.InvalidProgramException: InvalidProgram_Default
       at AppKit.NSGridView.Create(NSView[,])
       at MonoTouchFixtures.AppKit.NSGridViewTest.<>c__DisplayClass8_0.<CreateWithTwoDimensionalNSViewArrayWithNullCell>b__0()
       at NUnit.Framework.Assert.Throws(IResolveConstraint, TestDelegate, String, Object[] )>

    		   at MonoTouchFixtures.AppKit.NSGridViewTest.CreateWithTwoDimensionalNSViewArrayWithNullCell()
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #b669991] Build passed (Build packages) ✅

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [PR Build #b669991] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ [CI Build #b669991] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [CI Build #b669991] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

.NET ( No breaking changes )

❗ API diff vs stable (Breaking changes)

.NET ( ❗ Breaking changes ❗ )

✅ Generator diff

Generator diff is empty

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [CI Build #b669991] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [CI Build #b669991] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [CI Build #b669991] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [CI Build #b669991] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 115 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 8 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 8 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: b6699911579d6aee09b8b2203f3ccbb0b9668e12 [PR build]

@rolfbjarne
rolfbjarne merged commit 8b55e25 into main Apr 7, 2025
@rolfbjarne
rolfbjarne deleted the dev/rolf/rewriter-handle-exception-clauses branch April 7, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants