Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Raw profiler hook fails because of a null ref

Abierto
#371 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
devtools

Línea de trabajo

Comienza en CCorProfilerInfoWrapper::GetILFunctionBody y sigue el estado de CMethodInfo después de SetFinalRenderedFunctionBody, especialmente la relación entre m_bIsInstrumented, m_pIntermediateRenderedMethod y m_pFinalRenderedMethod. Compara el cambio propuesto en SetFinalRenderedFunctionBody con el issue 370 y el commit referenciado. Se considera terminado cuando la reescritura de raw-profiler ya no produce una referencia nula ni un HRESULT de error y recupera el cuerpo de método válido.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

This is somewhat relate to https://github.com/microsoft/CLRInstrumentationEngine/issues/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.

One possible fix is to update CMethodInfo::SetFinalRenderedFunctionBody so that it sets m_pIntermediateRenderedMethod if it is not already set. I believe this works, but can't test it properly because of the other issue: https://github.com/robertpi/CLRInstrumentationEngine/commit/22b96b56ec69b1cdb74e9d0d5f3a73169385a923#diff-9025cfc4efbe6666f69f6103e8d4aca595e5107e7c0ec46d644b3f34345717c9R1314

There maybe other better ways to fix this.

Lenguaje dominante
C++
Estrellas
105
Forks
53
Merge medio
3 d 14 h
PR fusionados (30 d)
4

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/CLRInstrumentationEngine

Todos los issues de microsoft/CLRInstrumentationEngine

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.