ASan uses a very large amount of virtual memory to do its bookkeeping (20TB). When running the gcore command, GDB attempts to include the shadow memory of the process causing the core dump to reach the amount of available disk space before failing.
Based on my reading of https://sourceware.org/bugzilla/show_bug.cgi?id=16092, https://sourceware.org/ml/gdb-patches/2015-03/msg00144.html, and the changes in https://reviews.llvm.org/D7294?id=19035, I think GDB should already be respecting the madvise() settings when it goes to take a core dump.
However, until we are able to determine if there's different bits to set to modifies GDB's behavior, we should run hang_analyzer.py without specifying -c on the following build variants that compile with --sanitize=address:
This can be accomplished by setting a new hang_analyzer_dump_core=false expansion on the aforementioned build variants and defaulting the expansion to true if it is unset.