Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Raw profiler hook fails because of a null ref

Aperta
#371 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp
Ambito
devtools

Direzione di ricerca

Parti da CCorProfilerInfoWrapper::GetILFunctionBody e segui lo stato di CMethodInfo dopo SetFinalRenderedFunctionBody, in particolare la relazione tra m_bIsInstrumented, m_pIntermediateRenderedMethod e m_pFinalRenderedMethod. Confronta la modifica proposta a SetFinalRenderedFunctionBody con l’issue 370 e il commit indicato. Il lavoro è completato quando la riscrittura di raw-profiler non produce più un riferimento nullo né un HRESULT di errore e recupera il corpo del metodo valido.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
C++
Stelle
105
Fork
53
Merge medio
3g 14h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/CLRInstrumentationEngine

Tutte le issue di microsoft/CLRInstrumentationEngine

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.