Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

monomod[bot]
Copy link
Contributor

@monomod monomod bot commented May 26, 2025

Test for #230

  • Reproduces the issue with IL manipulation on Mono runtime
  • Ensures multiple ILHook applications do not throw InvalidProgramException
  • Checks that IL cursor manipulation works correctly across multiple hooks

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

Test Results

Total Skipped Passed Failed
Unique 282 0 281 1
Total 25370 180 25187 3

Failing runs

❌ MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed

Class Name: MonoMod.UnitTest.Github.Issue230 | Method Name: ILHookOnMonoShouldSucceed | This test is sometimes failing.

Failures present in
  • test-results System Mono on Linux/testresults.ubuntu-latest.sysmono.x64.xml
  • test-results System Mono on MacOS 13/testresults.macos-13.sysmono.x64.xml
  • test-results System Mono on MacOS 14/testresults.macos-14.sysmono.arm64.xml
❌ test-results System Mono on Linux/testresults.ubuntu-latest.sysmono.x64.xml MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed

Took 00:00:00.0300636

Exception message:

System.InvalidProgramException : Invalid IL code in (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:DMD<DMD<>?1848273159::MonoMod.UnitTest.Github.Issue230::Original> (): IL_0078: call      0x0000001d


Stack trace:

  at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
  at MonoMod.Core.Platforms.Runtimes.MonoRuntime.Compile (System.Reflection.MethodBase method) [0x00008] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.Core.Platforms.PlatformTriple.Compile (System.Reflection.MethodBase method) [0x00047] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.UpdateEndOfChain () [0x000e1] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.AddILHook (MonoMod.RuntimeDetour.DetourManager+SingleILHookState ilhook, System.Boolean takeLock) [0x000e9] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00052] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase method, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.Core.IDetourFactory factory, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00098] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config) [0x00000] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed () [0x00052] in <398229fd63874cfba109f8835c57d9e3>:0 
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0007c] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
❌ test-results System Mono on MacOS 13/testresults.macos-13.sysmono.x64.xml MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed

Took 00:00:00.3527562

Exception message:

System.InvalidProgramException : Invalid IL code in (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:DMD<DMD<>?1228122713::MonoMod.UnitTest.Github.Issue230::Original> (): IL_0078: call      0x0000001d


Stack trace:

  at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <bab7d1a00376483b944db50cdc31e41d>:0 
  at MonoMod.Core.Platforms.Runtimes.MonoRuntime.Compile (System.Reflection.MethodBase method) [0x00008] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.Core.Platforms.PlatformTriple.Compile (System.Reflection.MethodBase method) [0x00047] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.UpdateEndOfChain () [0x000e1] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.AddILHook (MonoMod.RuntimeDetour.DetourManager+SingleILHookState ilhook, System.Boolean takeLock) [0x000e9] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00052] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase method, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.Core.IDetourFactory factory, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00098] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config) [0x00000] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed () [0x00052] in <398229fd63874cfba109f8835c57d9e3>:0 
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <bab7d1a00376483b944db50cdc31e41d>:0 
❌ test-results System Mono on MacOS 14/testresults.macos-14.sysmono.arm64.xml MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed

Took 00:00:00.0774455

Exception message:

System.InvalidProgramException : Invalid IL code in (wrapper dynamic-method) MonoMod.Utils.DynamicMethodDefinition:DMD<DMD<>?561657778::MonoMod.UnitTest.Github.Issue230::Original> (): IL_0078: call      0x0000001d


Stack trace:

  at (wrapper managed-to-native) System.RuntimeMethodHandle.GetFunctionPointer(intptr)
  at System.RuntimeMethodHandle.GetFunctionPointer () [0x00000] in <bab7d1a00376483b944db50cdc31e41d>:0 
  at MonoMod.Core.Platforms.Runtimes.MonoRuntime.Compile (System.Reflection.MethodBase method) [0x00008] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.Core.Platforms.PlatformTriple.Compile (System.Reflection.MethodBase method) [0x00047] in <1b542038f0814eb49468b7aafb4cbafb>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.UpdateEndOfChain () [0x000e1] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.DetourManager+ManagedDetourState.AddILHook (MonoMod.RuntimeDetour.DetourManager+SingleILHookState ilhook, System.Boolean takeLock) [0x000e9] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook.Apply () [0x00052] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase method, MonoMod.Cil.ILContext+Manipulator manipulator, MonoMod.Core.IDetourFactory factory, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00098] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config, System.Boolean applyByDefault) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip, MonoMod.RuntimeDetour.DetourConfig config) [0x00000] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.RuntimeDetour.ILHook..ctor (System.Reflection.MethodBase source, MonoMod.Cil.ILContext+Manipulator manip) [0x00008] in <a414cb74f6124b8fbcfc5b3634e1658a>:0 
  at MonoMod.UnitTest.Github.Issue230.ILHookOnMonoShouldSucceed () [0x00052] in <398229fd63874cfba109f8835c57d9e3>:0 
  at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
  at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <bab7d1a00376483b944db50cdc31e41d>:0 

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.

2 participants