MdbWriter doesn't write the correct MVID when using deterministic MVID #680

Closed
opened 2020-07-16 10:58:21 -05:00 by vitek-karas · 2 comments
vitek-karas commented 2020-07-16 10:58:21 -05:00 (Migrated from github.com)

MdbWriter caches the MVID to write upon construction of the writer from the module's Mvid property. But in case of deterministic MVID the actual MVID is computed after the MdbWriter is constructed. So the symbols end up using the wrong (Typically all zeroes) MVID.

I looked at how PortablePdb does this, and the writer in this case holds on to the ModuleDefinition and reads its Mvid property only when actually writing the symbols (which is after it was populated with the right value).

MdbWriter caches the MVID to write upon construction of the writer from the module's Mvid property. But in case of deterministic MVID the actual MVID is computed after the MdbWriter is constructed. So the symbols end up using the wrong (Typically all zeroes) MVID. I looked at how PortablePdb does this, and the writer in this case holds on to the ModuleDefinition and reads its Mvid property only when actually writing the symbols (which is after it was populated with the right value).
jbevain commented 2020-07-16 16:28:04 -05:00 (Migrated from github.com)

@vitek-karas good catch, could up send your PR upstream? Thanks!

@vitek-karas good catch, could up send your PR upstream? Thanks!
vitek-karas commented 2020-07-20 09:16:06 -05:00 (Migrated from github.com)

@jbevain ported to upstream in https://github.com/jbevain/cecil/pull/681

@jbevain ported to upstream in https://github.com/jbevain/cecil/pull/681
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-jbevain/cecil#680
No description provided.