Microsoft KB Archive/310833

= SetILInstrumentedCodeMap may cause access violation =

Article ID: 310833

Article Last Modified on 1/11/2006

-

APPLIES TO


 * Microsoft Visual C++ .NET 2002 Standard Edition
 * Microsoft .NET Framework 1.0
 * Microsoft Visual C++ .NET 2003 Standard Edition
 * Microsoft Visual C++ 2005 Express Edition

-



This article was previously published under Q310833



SYMPTOMS
ICorProfilerInfo::SetILInstrumentedCodeMap may cause an access violation in the managed application that is being profiled if it is called from a JITCompilationStarted callback.



CAUSE
The fStartJit flag is set to FALSE when ICorProfilerInfo::SetILInstrumentedCodeMap is called the first time.



RESOLUTION
To avoid this problem, always set the fStartJit flag to TRUE when SetILInstrumentedCodeMap is called for the first time. On any subsequent calls, set it to TRUE on a per method basis.



STATUS
This behavior is by design.

