You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is somewhat relate to #370, as it seems impossible to test them separately, but I believe it a separate issue.
It seems if a raw profiler chooses to rewrite a method but it hasn't been rewritten by an instrumentation method then an null ref will occur, or rather the functions will start to return fail HRESULTs because of a null ref.
For an existing method that has been instrumented by the raw profiler but not an instrumentation method CCorProfilerInfoWrapper::GetILFunctionBody will call pMethodInfo->GetIntermediateRenderedFunctionBody. This because pMethodInfo->IsInstrumented() has been set when CMethodInfo::SetFinalRenderedFunctionBody was called.
This means that we're in a state where m_bIsInstrumented is true, m_pIntermediateRenderedMethod is null and m_pFinalRenderedMethod is set to a valid method body.
So, our CMethodInfo has a valid method body, but I'm not sure what the correct way to retrieve it.
I think that this might be the same issue as discussed in #370, and it has to do with usage of IMethodMalloc. Let's discuss over there first to see if that is the problem.
This is somewhat relate to #370, as it seems impossible to test them separately, but I believe it a separate issue.
It seems if a raw profiler chooses to rewrite a method but it hasn't been rewritten by an instrumentation method then an null ref will occur, or rather the functions will start to return fail HRESULTs because of a null ref.
For an existing method that has been instrumented by the raw profiler but not an instrumentation method
CCorProfilerInfoWrapper::GetILFunctionBody
will callpMethodInfo->GetIntermediateRenderedFunctionBody
. This becausepMethodInfo->IsInstrumented()
has been set whenCMethodInfo::SetFinalRenderedFunctionBody
was called.This means that we're in a state where
m_bIsInstrumented
is true,m_pIntermediateRenderedMethod
is null andm_pFinalRenderedMethod
is set to a valid method body.So, our
CMethodInfo
has a valid method body, but I'm not sure what the correct way to retrieve it.One possible fix is to update
CMethodInfo::SetFinalRenderedFunctionBody
so that it setsm_pIntermediateRenderedMethod
if it is not already set. I believe this works, but can't test it properly because of the other issue: robertpi@22b96b5#diff-9025cfc4efbe6666f69f6103e8d4aca595e5107e7c0ec46d644b3f34345717c9R1314There maybe other better ways to fix this.
The text was updated successfully, but these errors were encountered: