Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Invalid IL program detected in Event Log - .Net Profiler

$
0
0

I am injecting the entry and exit function call ILs into the .Net code from my profiler. 

The signature of the function that i inject is 

COR_SIGNATURE sigFunctionProbe4[] = {
		IMAGE_CEE_CS_CALLCONV_DEFAULT,      // default calling convention
		0x03,
		ELEMENT_TYPE_VOID,
		ELEMENT_TYPE_U8,
		ELEMENT_TYPE_I4,
		ELEMENT_TYPE_I4,
	};

and the corresponding function's definition in the helper assembly is 

public static void EnterFunction(UInt64 fID, int flag1, int flag2)
{
..
..
}

The application that i am profiling is "Citrix Director" . In this case when my profiler gets attached to the application  , the application does not even log in and throws an error in EventLog ("the w3wp.exe process is not crashed") as attached in the image 

But if i Add en extra argument in the signature of the method , then everything works fine - The highly confusing part. 

Works Fine with the following 

COR_SIGNATURE sigFunctionProbe4[] = {
		IMAGE_CEE_CS_CALLCONV_DEFAULT,      // default calling convention
		0x04,
		ELEMENT_TYPE_VOID,
		ELEMENT_TYPE_U8,
		ELEMENT_TYPE_I4,
		ELEMENT_TYPE_I4,
		ELEMENT_TYPE_I4,
	};

public static void EnterFunction(UInt64 fID, int flag1, int flag2, int flag3)
{
..
..
}

Should i inject an helper function call with four arguments only..? (this happens only for profiling few applications - for many other web applications profiler works flawlessly)


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>