perfview icon indicating copy to clipboard operation
perfview copied to clipboard

PerfView cannot load symbols with a path > 250 chars

Open Alois-xx opened this issue 5 years ago • 5 comments

This is a long standing issue and I would have thought that this is already solved. When trying to make it work I did find that commit 5f738b85d44f43240ec00e45a81a1a1576224fa5 made matters worse where long path handling is explicitely disabled via dirty reflection hacks. The container symbol resolution is a corner case I think where there are other ways to detect if you are running inside a container. The general approach should be to allow long path names. To make it work PerfView needs

  • Since it is targetting .NET 4.0 an extra appsetting
<runtime>   
      <AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" /> 
</runtime>
  • An application manifest to enable native long path support
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      **<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>**
    </windowsSettings>
  </application>
  • On the machine where it runs long path names must be enabled

See blog post https://docs.microsoft.com/en-us/archive/blogs/jeremykuhne/net-4-6-2-and-long-paths-on-windows-10 for the full details.

Is this on the list or am I the only one loading symbols with long path names?

Alois-xx avatar Nov 05 '20 12:11 Alois-xx

I don't believe that there is anything tracking long path support, so this issue can be used to do so. https://github.com/microsoft/perfview/commit/5f738b85d44f43240ec00e45a81a1a1576224fa5 is actually for reaching into Windows process isolation containers to get PDB information from binaries that show up in the trace when captured on a host. UseLegacyPathHandling=false is set to go down a different path that allows us to reach into containers. We could likely do this with native code directly and remove the code that sets this. I'll mark this as an enhancement - do you want to work on this and submit a PR?

brianrob avatar Nov 07 '20 23:11 brianrob

Sure I have opened PR #1314

Alois-xx avatar Nov 09 '20 08:11 Alois-xx

@brianrob: Is the PR ok or when will it be merged?

Alois-xx avatar Nov 15 '20 20:11 Alois-xx

@alois-xx, I need to do a bit of research on your proposed change to understand the details, especially around the manifest file. Let me look into this and report back.

brianrob avatar Nov 16 '20 04:11 brianrob

@brianrob: Is it now ok?

Alois-xx avatar Dec 04 '20 15:12 Alois-xx