Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
460 stars 19 forks source link

ScoreDataExtractor crashes when stopping #10

Closed b-winkler closed 3 years ago

b-winkler commented 3 years ago

Here is what I do:

I am using

Microsoft Visual Studio Professional 2019 Version 16.7.2 VisualStudio.16.Release/16.7.2+30413.136 Microsoft .NET Framework Version 4.8.03752

Not a lot of information, I am afraid. Please tell me if there is anything more specific I can provide.

Thanks in advance, Benjamin

Viladoman commented 3 years ago

Sorry about that. Sadly, there is not much information I can use to pinpoint the issue.

In order to narrow it down, I would recommend to do the following steps:

This way we can see what is the problematic step (gathering or processing) I am pretty sure it is failing in the extraction/processing part (as the first one is mainly MS Build insights sdk calls for msvc), but always good to double check.

If the extractor is the one crashing I would then recommend to just clone this repo, open the DataExtractorSolution, Go to the Project Settings - Debugging and use the command arguments from the last step. This way we will get a callstack. Also, because the data is already in the etl file VS does not need to run in Admin mode.

Thanks for your help. Please let me know the outcome.

b-winkler commented 3 years ago

Hi Ramon,

thanks for the quick response. Yes, you were right, the extraction is the one causing problems, .etl file is created successfully. I will try to analyze the extraction issue as you proposed, will get back to you with more infos. But this will probably take a few days.

Cheers, Benjamin

PS: I could not find information about why ScoreGenerator needs to be started in elevated mode. Did not seem to make a difference in my environment?

Viladoman commented 3 years ago

No rush! Let me know what you find in there.

I checked what you are mentioning about the elevated mode and you are right, maybe MS updated their Build insights to not require it anymore and I was still under the impression it was mandatory. I will run some tests and remove the elevated requirement if it is not needed anymore.

Thanks for letting me know!

Edit: After several tests... I will remove the elevated restriction as apparently it is not needed anymore! Good news! :)

b-winkler commented 3 years ago

Sorry for the delay. I just ran ScoreDataExtractor in Debug mode and reproduced the crash, only to find out that someone else has reported the same bug, just with more detailed information. So, same here: OnCompilerPassStart() is being called with activity.InputSourcePath and activity.OutputObjectPath == nullptr

Benjamin

Viladoman commented 3 years ago

I think I got a workaround for the issue with the missing activity names meanwhile it is not fixed in the SDK.

FYI, I left a more detailed information of the workaround in the other issue thread

Whenever you have time could you validate if the profiler works on version 1.5.6 when using the /MP ( which was the root cause of the SDK not giving up the path names ).

Thanks for the investigation, I really appreciate it.

b-winkler commented 3 years ago

Hey Ramon, workaround seems to have fixed it. At least it did not crash anymore, though I did not look into the results, yet. Will do that later. Benni

b-winkler commented 3 years ago

Works perfectly! Thanks alot!

Benni