microsoft/WinDbg-Samples

Symbol Builder fails to import transitively self-referential function types

wmessmer-msft opened this issue · 1 comments

When using "AutoImportSymbols = true", the symbol builder dynamically imports types and data symbols from an underlying PDB. Unfortunately, this auto import is broken for any function type symbol which has a transitive self-reference within it. If some UDT has a pointer-to-function... and the signature for that function has a return type or a parameter which refers back to that same signature (e.g.: a similar pointer-to-function), the import fails...

The first attempt to import the function type starts.... it recurses... hits the transitive reference... which attempts to import again... which succeeds (generating a new symbol with an id of 'A') ... as the recursion unwinds, the importer creates a NEW FunctionTypeSymbol at the outer level with an id of 'B'). When the importer sees that one PDB ID (for the function type symbol) maps to two DIFFERENT symbol builder IDs (both 'A' and 'B'), it fails with a catastrophic failure leaving the import half complete.

UDTs solve this issue by creating a shell of the UDT upfront and filling it in as the import progresses. Function types need to do a similar thing to deal with this.

This should be fixed after PR #92