Smart-Inspector icon indicating copy to clipboard operation
Smart-Inspector copied to clipboard

Win32Exception: Invalid data

Open goldfire opened this issue 2 years ago • 2 comments

I'm trying this out on my Mac (M1 MacBook Pro) and am getting the following error, which seems to be preventing any of the functionality from working. Not really sure where to start debugging this though. I'm using Unity 2021.2.7f1.

Win32Exception: Invalid data
MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform.SetMemPerms (System.IntPtr start, System.UInt64 len, MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform+MmapProts prot) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.Platforms.DetourNativeLibcPlatform.MakeWritable (System.IntPtr src, System.UInt32 size) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.DetourHelper.MakeWritable (MonoMod.RuntimeDetour.IDetourNativePlatform plat, MonoMod.RuntimeDetour.NativeDetourData detour) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform._HookSelftest (System.Reflection.MethodInfo from, System.Reflection.MethodInfo to) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform..ctor () (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.Platforms.DetourRuntimeMonoPlatform..ctor () (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.DetourHelper.get_Runtime () (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
MonoMod.RuntimeDetour.DetourHelper.Pin[T] (T method) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
HarmonyLib.MethodPatcher.CreateReplacement (System.Collections.Generic.Dictionary`2[System.Int32,HarmonyLib.CodeInstruction]& finalInstructions) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
HarmonyLib.PatchFunctions.UpdateWrapper (System.Reflection.MethodBase original, HarmonyLib.PatchInfo patchInfo) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
HarmonyLib.PatchProcessor.Patch () (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
HarmonyLib.Harmony.Patch (System.Reflection.MethodBase original, HarmonyLib.HarmonyMethod prefix, HarmonyLib.HarmonyMethod postfix, HarmonyLib.HarmonyMethod transpiler, HarmonyLib.HarmonyMethod finalizer) (at <6a6ad8af2f3f4540b557caf0a3956e48>:0)
AV.Inspector.PatchBase.ApplyPatches (AV.Inspector.PatchBase+Apply applyType) (at Library/PackageCache/[email protected]/Patches/Provider/PatchBase.cs:100)
AV.Inspector.Patcher.ApplyPatches (AV.Inspector.PatchBase+Apply apply) (at Library/PackageCache/[email protected]/Patches/Provider/Patcher.cs:79)
AV.Inspector.Patcher.ApplyPatches () (at Library/PackageCache/[email protected]/Patches/Provider/Patcher.cs:35)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <bd21fd595d394493a51e7c79b5fef9e0>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnitySynchronizationContext.cs:153)
UnityEngine.UnitySynchronizationContext.Exec () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnitySynchronizationContext.cs:83)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/UnitySynchronizationContext.cs:107)

goldfire avatar Dec 30 '21 21:12 goldfire

Harmony (Internal library) dont support Apple ARM =( https://github.com/pardeike/Harmony/issues/424

Need remove support ARM Apple for this package=(

AlexeyTaranov avatar May 25 '22 20:05 AlexeyTaranov

I will (soon?) try to rewrite Smart Inspector to remove Harmony dependency, as it's internal initialization + Mono Cecil slows down the Editor during recompilation/domain reload for about 1~2 seconds

neon-age avatar May 26 '22 09:05 neon-age