You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In summary: when building on windows, rustc can generate symbol names into the .pdb file that microsoft's DIA library doesn't like. In particular, it can result in calls to get_undecoratedNameEx to crash with a divide-by-zero. This is a bug in the DIA library which I reported to a friend at Microsoft and which has been fixed. However, older versions of the DIA library still have this problem, so rustc should probably be updated to not generate such symbols.
This bug results in the mozilla-central dump_syms.exe crashing which in turn generates a bad .sym file which causes windows debug tests to blow up. For now I have a workaround patch ready to land that catches the div-by-zero in dump_syms.exe. @luser suggested that if there is some runtime workaround (e.g. setting rustflags or something) that can avoid this problem, we should do that instead - so if there is anything I can try along those lines, please let me know.
Thanks for the report. It looks like we are doing this on purpose for arrays we don't know the size of. I'll try to find out if we can do something else here.
So the real culprit here is the DISubroutineType that is assigned to every function. It seems that MSDIA has a problem with fixed-size arrays of u8 or anything zero-sized. Fixed-size arrays of any other type (including i8, interestingly) are handled without crashes. Here's a table of various types and sizes I've tested:
type \ len 0 1 2 9 100
---------------------------------------------
() f f f f
u8 f f f f f
i8 ok ok ok ok
u16 ok ok ok ok ok
u32 ok ok ok ok ok
struct(u8) ok ok ok ok
zero-sized-struct f f f f
My proposed fix/workaround is to adapt parameter types within DISubroutineType, so that fixed-size arrays are replaced with pointers when compiling against MSVC. DISubroutineType is already inaccurate anyway, so things don't get worse at least.
Backstory in https://bugzilla.mozilla.org/show_bug.cgi?id=1343625 (comment 16 has dmajor's analysis).
In summary: when building on windows, rustc can generate symbol names into the .pdb file that microsoft's DIA library doesn't like. In particular, it can result in calls to
get_undecoratedNameEx
to crash with a divide-by-zero. This is a bug in the DIA library which I reported to a friend at Microsoft and which has been fixed. However, older versions of the DIA library still have this problem, so rustc should probably be updated to not generate such symbols.This bug results in the mozilla-central dump_syms.exe crashing which in turn generates a bad .sym file which causes windows debug tests to blow up. For now I have a workaround patch ready to land that catches the div-by-zero in dump_syms.exe. @luser suggested that if there is some runtime workaround (e.g. setting rustflags or something) that can avoid this problem, we should do that instead - so if there is anything I can try along those lines, please let me know.
/cc @michaelwoerister
The text was updated successfully, but these errors were encountered: