[ ] Add an asan_blacklist.txt to druntime and to phobos (separate). Start from this one, add lines to simply blacklist all functions in druntime and phobos:
# Blacklist for Address Sanitizer. Turns off instrumentation of particular
# functions or sources. Use with care. You may add blacklists
# at compile-time using -fsanitize-blacklist=<path> flag.
Example usage:
fun:bad_function_name
src:file_with_tricky_code.cc
Blacklist druntime functions whose inline assembly does not sit well with
- [ ] Make sure the asan_blacklist.txt files are part of the LDC installation package.
- [ ] Add -fsanitize-blacklist=... for these blacklist files to ldc.conf (user should not need to know about what to blacklist in phobos/druntime)
- [ ] Add simple test that indeed the blacklist is working for phobos and druntime. Tricky: test that blacklisting druntime or phobos is loaded by either `-v` output, or by testing that a function that should _always_ be blacklisted is indeed not instrumented...
- [ ] Add a CI test of Phobos unittests with ASan enabled.
Once that is in place: slowly reduce the amount of blacklisting of Phobos and druntime functions! (Expect to make bug fixes!)
Initial steps:
Example usage:
fun:bad_function_name
src:file_with_tricky_code.cc
Blacklist druntime functions whose inline assembly does not sit well with
ASan yet, see https://github.com/ldc-developers/ldc/issues/2257
fun:_DcallWithStackShell fun:_DgetcacheinfoCPUID2
Functions from the conservative gc druntime
fun:12conservative2gc fun:_D4core5cpuid*