Raw profiler hook fails because of a null ref
まだ誰も着手していません。
評価
調査の方向性
CCorProfilerInfoWrapper::GetILFunctionBody から開始し、SetFinalRenderedFunctionBody 後の CMethodInfo の状態を追跡します。特に、m_bIsInstrumented、m_pIntermediateRenderedMethod、m_pFinalRenderedMethod の関係を確認します。SetFinalRenderedFunctionBody に対して提案されている変更を issue 370 および参照されている commit と比較します。raw-profiler による書き換えで null 参照や失敗 HRESULT が発生せず、有効なメソッド本体を取得できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- C++
- スター
- 105
- フォーク
- 53
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 4
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/CLRInstrumentationEngine のほかの issue
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
microsoft/CLRInstrumentationEngine#169 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
microsoft/CLRInstrumentationEngine#526 · リアクション 1 件 ·
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
microsoft/CLRInstrumentationEngine の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
[BUG] Clipboard History: Buffer over-read in WideCharToMultiByte on double-click paste対応中かも @softmgr が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
notepad-plus-plus/notepad-plus-plus#18519 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
justcallmekoko/ESP32Marauder#1635 ·
メンテナーはふだん 1 日以内に返信
-
3.7.6-dev commit 80481ea - files not centered when resolution differs and zoom = "pixel-to-pixel"オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
grizzlypeak3d/DJV#931 ·