MetanoKid / cpp-build-analyzer

Analyzes MSVC C++ compilations with C++ Build Insights SDK
GNU General Public License v3.0
80 stars 2 forks source link

Crash when analyzing #13

Closed rconde01 closed 4 years ago

rconde01 commented 4 years ago

I successfully generated my trace file, but got a crash when i go to analyze it. The call stack is:

    CppBuildInsights.dll!00007ffb52033a22() Unknown
    CppBuildInsights.dll!00007ffb52034874() Unknown
    CppBuildInsights.dll!00007ffb52048119() Unknown
    CppBuildInsights.dll!00007ffb5204c89a() Unknown
    CppBuildInsights.dll!00007ffb5204a0ed() Unknown
    CppBuildAnalyzer.exe!Microsoft::Cpp::BuildInsights::Analyze<Microsoft::Cpp::BuildInsights::Internal::AnalyzerSmartPtrImpl<Microsoft::Cpp::BuildInsights::Internal::DynamicSmartPtrAnalyzerGroupImpl<Microsoft::Cpp::BuildInsights::IAnalyzer *,Microsoft::Cpp::BuildInsights::Internal::RawPtrWrapper<Microsoft::Cpp::BuildInsights::IAnalyzer>>,Microsoft::Cpp::BuildInsights::Internal::RawPtrWrapper>>(const char * inputLogFile=0x000001ab1acbfd60, unsigned int numberOfPasses=1, Microsoft::Cpp::BuildInsights::StaticAnalyzerGroup<Microsoft::Cpp::BuildInsights::Internal::AnalyzerSmartPtrImpl<Microsoft::Cpp::BuildInsights::Internal::DynamicSmartPtrAnalyzerGroupImpl<Microsoft::Cpp::BuildInsights::IAnalyzer *,Microsoft::Cpp::BuildInsights::Internal::RawPtrWrapper<Microsoft::Cpp::BuildInsights::IAnalyzer>>,Microsoft::Cpp::BuildInsights::Internal::RawPtrWrapper>> analyzerGroup={...}) Line 3376  C++
    CppBuildAnalyzer.exe!BuildAnalyzer::Analyze() Line 46   C++
>   CppBuildAnalyzer.exe!main(int argc=1, char * * argv=0x000001ab1acbd230) Line 94 C++

The trace file is ~1GB but the memory of CppBuildAnalyzer is only 100MB when it crashes.

rconde01 commented 4 years ago

Hmm...seems similar to this:

https://developercommunity.visualstudio.com/content/problem/887569/c-build-insights-vcperf-fails-during-analysis.html

MetanoKid commented 4 years ago

Hi, @rconde01!

Indeed, the stack trace looks like it's an issue with the C++ Build Insights SDK. Thank you for posting it in Microsoft's forums and providing the link here.

What we can do, on our end, is handling the possible exceptions in the SDK and show an error with the full stack. Something like #4.

I'll leave this issue on hold and monitor your linked post in Developer Community.

MetanoKid commented 4 years ago

Hello, @rconde01!

Just a quick update: While there's no word from the C++ Build Insights SDK (so this issue isn't yet fixed), your report helped me provide a way for users to include extra information when reporting crashes.

We now generate MiniDumps when crashing, as part of #30. I've made it crash the way this issue does and this is the sample MiniDump:

CppBuildAnalyzer_20200519_121745.zip. Requires .exe and .pdb from commit 57f3d78.

I'm still leaving this issue on hold until we get an updated SDK with the fix. Thank again!

uberdrake commented 4 years ago

MS has a patch on deck: https://github.com/microsoft/cpp-build-insights-samples/issues/5

rconde01 commented 4 years ago

cool - hopefully that does it.

MetanoKid commented 4 years ago

Thanks for the heads up!

MetanoKid commented 4 years ago

I've upgraded the SDK to v1.1.0 successfully and I'm no longer able to reproduce the crash. Can you please check with the linked Pull Request?

Thank you!

rconde01 commented 4 years ago

Works for me now - closing.