如何在 godbolt.org 启用地址清理程序

How to enable address sanitizer at godbolt.org

我试图在 godbolt.org 和 -fsanitize=address 启用地址清理器,但出现错误:

==3==ERROR: AddressSanitizer failed to allocate 0xdfff0001000 (15392894357504) bytes at address 2008fff7000 (errno: 12)
==3==ReserveShadowMemoryRange failed while trying to map 0xdfff0001000 bytes. Perhaps you're using ulimit -v

示例:https://godbolt.org/z/5GDtrr

如何正确启用地址清理程序?

根据设计,Asan 在启动时分配了大量虚拟内存(在 x86_64 机器上为 20 Tb)(详细信息 here). This may be a problem if overcommit is disabled or virtual memory is limited with ulimit -v

在这两种情况下,Asan 都无能为力 - 您需要向 https://github.com/mattgodbolt/compiler-explorer/issues

中的 Godbolt VM 维护者提出这个问题