-
Notifications
You must be signed in to change notification settings - Fork 757
Description
I have tried using PerfView to profile a rather large executable (I unfortunately cannot share), and I am encountering this exception found in the logs when trying to load its symbols:
An exception occurred during symbol lookup. Continuing...
Exception: System.InvalidOperationException: Bad PE Header.
at PEFile.PEHeader..ctor(Void* startOfPEFile)
at PEFile.PEFile..ctor(String filePath)
at Microsoft.Diagnostics.Tracing.Etlx.TraceCodeAddresses.TraceModuleUnchanged(TraceModuleFile moduleFile, TextWriter log, String overrideModuleFilePath)
at Microsoft.Diagnostics.Tracing.Etlx.TraceCodeAddresses.OpenPdbForModuleFile(SymbolReader symReader, TraceModuleFile moduleFile)
at Microsoft.Diagnostics.Tracing.Etlx.TraceCodeAddresses.LookupSymbolsForModule(SymbolReader reader, TraceModuleFile moduleFile, IEnumerator`1 codeAddressIndexCursor, Boolean enumerateAll, Int32& totalAddressCount)
at Microsoft.Diagnostics.Tracing.Etlx.TraceCodeAddresses.LookupSymbolsForModule(SymbolReader reader, TraceModuleFile file)
After investigation, it is triggered by this check in the PEFile constructor:
if (!(sizeof(IMAGE_DOS_HEADER) <= imageHeaderOffset && imageHeaderOffset <= 512))
I see imageHeaderOffset is 560 in my executable. It seems bumping the threshold might be a way to fix it, at least locally increasing it to 1024 did the trick.
Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels