System.Reflection.Emit SetChecksum
produces invalid pdb
#110096
Labels
area-System.Reflection.Emit
in-pr
There is an active PR which will close this issue when it is merged
untriaged
New issue has not been triaged by the area owner
Description
Calling
ISymbolDocumentWriter.SetChecksum
on aISymbolDocumentWriter
returned fromModuleBuilder.DefineDocument
results in a pdb with a document table containing a document with aHash
field that is an invalid blob handle.I've traced the problem to this line:
runtime/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs
Line 606 in 1b85184
That line should refer to
_pdbBuilder
, not_metadataBuilder
. Because it's_metadataBuilder
, the blob handle actually points into the blob heap in the emitted .dll, not the .pdb.I'll put up a PR with the fix.
Reproduction Steps
Expected behavior
I expect the repro above to succeed.
Actual behavior
It crashes while attempting to retrieve the blob bytes corresponding to the document's
Hash
blob handle:Regression?
No response
Known Workarounds
No response
Configuration
.NET 9.0, Windows x64
Other information
No response
The text was updated successfully, but these errors were encountered: