peppy
In a hooking/detouring scenario, "A callback was made on a garbage collected delegate of type (...)"
Solved here -> https://discord.com/channels/143867839282020352/663803973119115264/1118881102044598342.
8 replies
In a hooking/detouring scenario, "A callback was made on a garbage collected delegate of type (...)"
Which admittedly doesn't do much to explain what's going on for me, but I'll raise it with the relevant folks and see if they can clarify why the two would not be able to coexist.
8 replies
In a hooking/detouring scenario, "A callback was made on a garbage collected delegate of type (...)"
Okay, it gets more confusing.
If I run my hooks alone, as I normally do, everything works just fine. No problems, and definitely no crashes with randomly "garbage collected" delegates.
That being said. For this particular application, there is another oft-used .NET application that runs beside it. It attaches to the process and twiddles a few knobs. It is only when it runs side-by-side with my hooks that I get this nonsense occurring.
8 replies
In a hooking/detouring scenario, "A callback was made on a garbage collected delegate of type (...)"
however I thought thatYeah, exactly. The delegate type I'm using here (PrintfVarargDelegate) is markedGetFunctionPointerForDelegate
on aUnmanagedFunctionPointerAttribute
with a reference was fine anyway.
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
,8 replies
✅ ✅ Vararg P/Invoke (x86) throws BadImageFormatException (0x80131124 "Index not found")
The assembly containing the P/Invoke signature is just a regular old class library:
https://github.com/fkelava/fahrenheit/blob/main/src/cs/Fahrenheit.CoreLib/Fahrenheit.CoreLib.csproj
and the assembly using it doesn't seem to me to be out of the ordinary either:
https://github.com/fkelava/fahrenheit/blob/main/src/cs/Fahrenheit.CLRHost/Fahrenheit.CLRHost.csproj
I build them and that's it- I host the CLR and jump into a static method in
CLRHost
67 replies