Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Raw profiler hook fails because of a null ref

Đang mở
#371 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu tại CCorProfilerInfoWrapper::GetILFunctionBody và theo dõi trạng thái của CMethodInfo sau SetFinalRenderedFunctionBody, đặc biệt là mối quan hệ giữa m_bIsInstrumented, m_pIntermediateRenderedMethod và m_pFinalRenderedMethod. So sánh thay đổi được đề xuất cho SetFinalRenderedFunctionBody với issue 370 và commit được tham chiếu. Được xem là hoàn tất khi việc viết lại bằng raw-profiler không còn tạo ra tham chiếu null hoặc HRESULT lỗi và lấy được thân phương thức hợp lệ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
C++
Star
105
Fork
53
Merge trung bình
3 ngày 14 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/CLRInstrumentationEngine

Tất cả issue của microsoft/CLRInstrumentationEngine

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.