Open dnadlinger opened 11 years ago
It ain't easy to verify this.
DMD uses memcmp
to compare strings. In many cases this leads to reads beyond the end of allocated memory which triggers an address sanitizer error (e.g. in dmd2/identifier.c
, methods equals
and compare
).
As result I am unable to compile a single source file with my address sanitizer-instrumented ldc compiler.
Ok, I got it. In all 3 cases it is in mtype.c
, function Type::nullAttributes
, line 404. It looks like that 128 bytes are read but only 120 bytes are allocated for this
. This is not a real problem but to get here I had to patch 2 other dmd source files...
This pull request https://github.com/D-Programming-Language/dmd/pull/2699 contains the upstream changes to build DMDFE with AddressSanitizer enabled.
Running the test suite under Clang
-fsanitize=address
yields the following errors:Not sure if these are real, though – this was on a build server, and for some reason, the symbol name were missing. Need to investigate those locally.