Git Product home page Git Product logo

Comments (4)

jander-msft avatar jander-msft commented on June 15, 2024

The log file has a bug where the new IL is also reported as the original IL. So if you were to compare them, they'll look exactly the same. However, this is probably not the case. Please use a tool such as ildasm to extract the IL for this method from the assembly itself and compare it to the IL reported in the log file. That'll tell you what changed, and then allow you to have a better understanding of if the instrumentation method is causing the issue or if CLRIE is causing it.

Separately, we'll try to fix the log file to really report the original IL.

from clrinstrumentationengine.

jakubch1 avatar jakubch1 commented on June 15, 2024

In this case I've changed our IM to not make any changes. So issue is on CLRIE side.

from clrinstrumentationengine.

jander-msft avatar jander-msft commented on June 15, 2024

There are other ways that an instrumentation method can affect the IL outside of the InstrumenMethod. It can define types, methods, fields, properties, stubs, p/invokes, etc and sometimes write method bodies whole-sale without ever going through InstrumentMethod.

Please compare the difference between the IL of the method from the original assembly vs the IL that CLRIE says it generated to determine what the actual difference is and get a better idea of what is causing the issue.

from clrinstrumentationengine.

jakubch1 avatar jakubch1 commented on June 15, 2024

This is original IL code:

.method public hidebysig static 
	class GetHdiPolicyValidationRequest.ValidationRequestDto GetHdiPolicyValidationRequest (
		class GetHdiPolicyValidationRequest.HdiJobMetadata job
	) cil managed 
{
	// Method begins at RVA 0x20bc
	// Code size 160 (0xa0)
	.maxstack 9
	.locals init (
		[0] class GetHdiPolicyValidationRequest.ValidationRequestDto validationRequest,
		[1] class GetHdiPolicyValidationRequest.ValidationRequestDto
	)

	IL_0000: nop
	IL_0001: newobj instance void GetHdiPolicyValidationRequest.ValidationRequestDto::.ctor()
	IL_0006: dup
	IL_0007: ldarg.0
	IL_0008: callvirt instance string GetHdiPolicyValidationRequest.HdiJobMetadata::get_ExperimentId()
	IL_000d: dup
	IL_000e: brtrue.s IL_001c

	IL_0010: pop
	IL_0011: ldsfld string [System.Runtime]System.String::Empty
	IL_0016: newobj instance void [System.Runtime]System.ArgumentNullException::.ctor(string)
	IL_001b: throw

	IL_001c: callvirt instance void GetHdiPolicyValidationRequest.ValidationRequestDto::set_ExperimentName(string)
	IL_0021: nop
	IL_0022: dup
	IL_0023: newobj instance void GetHdiPolicyValidationRequest.ExecutionContextDto::.ctor()
	IL_0028: dup
	IL_0029: newobj instance void GetHdiPolicyValidationRequest.ModuleInfoDto::.ctor()
	IL_002e: dup
	IL_002f: newobj instance void class [System.Collections]System.Collections.Generic.List`1<string>::.ctor()
	IL_0034: dup
	IL_0035: ldarg.0
	IL_0036: callvirt instance class GetHdiPolicyValidationRequest.ModuleInfoDto GetHdiPolicyValidationRequest.HdiJobMetadata::get_ModuleInfo()
	IL_003b: callvirt instance string GetHdiPolicyValidationRequest.ModuleInfoDto::get_ModuleId()
	IL_0040: callvirt instance void class [System.Collections]System.Collections.Generic.List`1<string>::Add(!0)
	IL_0045: nop
	IL_0046: callvirt instance void GetHdiPolicyValidationRequest.ModuleInfoDto::set_SnapshotIds(class [System.Collections]System.Collections.Generic.List`1<string>)
	IL_004b: nop
	IL_004c: dup
	IL_004d: ldarg.0
	IL_004e: callvirt instance string GetHdiPolicyValidationRequest.HdiJobMetadata::get_File()
	IL_0053: callvirt instance string [System.Runtime]System.String::ToLower()
	IL_0058: ldsfld string [System.Runtime]System.String::Empty
	IL_005d: callvirt instance bool [System.Runtime]System.String::EndsWith(string)
	IL_0062: brtrue.s IL_006b

	IL_0064: ldsfld string [System.Runtime]System.String::Empty
	IL_0069: br.s IL_0070

	IL_006b: ldsfld string [System.Runtime]System.String::Empty

	IL_0070: callvirt instance void GetHdiPolicyValidationRequest.ModuleInfoDto::set_Executable(string)
	IL_0075: nop
	IL_0076: dup
	IL_0077: ldsfld string [System.Runtime]System.String::Empty
	IL_007c: ldarg.0
	IL_007d: callvirt instance class [System.Collections]System.Collections.Generic.List`1<string> GetHdiPolicyValidationRequest.HdiJobMetadata::get_Args()
	IL_0082: call string [System.Runtime]System.String::Join(string, class [System.Runtime]System.Collections.Generic.IEnumerable`1<string>)
	IL_0087: callvirt instance void GetHdiPolicyValidationRequest.ModuleInfoDto::set_Arguments(string)
	IL_008c: nop
	IL_008d: callvirt instance void GetHdiPolicyValidationRequest.ExecutionContextDto::set_ModuleInfo(class GetHdiPolicyValidationRequest.ModuleInfoDto)
	IL_0092: nop
	IL_0093: callvirt instance void GetHdiPolicyValidationRequest.ValidationRequestDto::set_ExecutionContext(class GetHdiPolicyValidationRequest.ExecutionContextDto)
	IL_0098: nop
	IL_0099: stloc.0
	IL_009a: ldloc.0
	IL_009b: stloc.1
	IL_009c: br.s IL_009e

	IL_009e: ldloc.1
	IL_009f: ret
} // end of method PolicyUtilities::GetHdiPolicyValidationRequest

I compared both and apart of expected changes (brtrue.s -> brtrue) there are no changes in IL code.

But maxstack in original method is 9 and in CLRIE logs I can see 8. So probably this is the issue. It's similar to: #304 and dotnet/runtime#51828

from clrinstrumentationengine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.