This question was created in reference to: [Failed to build a working address sanitizer UnrealEditor on win64 (Engine version [Content removed]
We figured out how to get this working.
Here is what we do to get an address sanitizer editor build working on Windows:
- Use a monolithic build.
- Modular builds seem to crash due to the cyclic dependencies between modules not playing nicely with ASan.
- Use clang as the compiler.
- Add the relatively new flag -fsanitize-address-outline-instrumentation to prevent inlining of instrumentation.
- This reduced the size of our editor executable from 2.7 GiB to 2.0 GiB.
- Set the target to optimize for size.
- This reduced the size of our editor executable again from 2.0 GiB to 1.59 GiB.
These things combined got us an instrumented editor executable under the seemingly undocumented exe size limit of ~1.85 GiB.