microsoft / perfview

PerfView is a CPU and memory performance-analysis tool
http://channel9.msdn.com/Series/PerfView-Tutorial
MIT License
4.15k stars 708 forks source link

Error in opening Perf profile trace that complaining a concurrent update was performed #2063

Closed qizhang15 closed 2 months ago

qizhang15 commented 3 months ago

I try to open a Perf profile trace using WPA but keep getting the following error. I tried different WPA versions, not helping. The Linux Perf plugin version is 1.2.4. The error says, "A concurrent update was performed on this collection and corrupted its state".

Error

Ivan got the stack of exception and it shows from our "3rd party" TraceEvent lib that processes the file.

Exception

brianrob commented 3 months ago

This appears to be caused by multiple callers into the same LinuxPerfScriptStackSource, which is not supported. Are you able to see why there are two threads touching this object at the same time? The exception comes from a Dictionary lookup that occurs during a write operation into the same Dictionary. I am wondering if this is an issue in the plugin rather than LinuxPerfScriptStackSource.

ivberg commented 3 months ago

I can debug more to see if this is happening. However it should not be AFAIK. @qizhang15 can you test your file with PerfView GUI to see if this issue repros there as well?

brianrob commented 3 months ago

Thanks @ivberg. We can certainly protect that Dictionary with a lock, but I would love to understand the use before we do anything like that.

ivberg commented 2 months ago

Verified fixed manually using trace supplied by @qizhang15 . Thx @brianrob for the quick fix!

brianrob commented 2 months ago

Verified fixed manually using trace supplied by @qizhang15 . Thx @brianrob for the quick fix!

Excellent. Thanks for reporting.