gpt4 book ai didi

c++ - 是否可以将 AddressSanitizer 和 ThreadSanitizer 合并到一个版本中?

转载 作者:行者123 更新时间:2023-12-03 08:17:30 25 4
gpt4 key购买 nike

或者我必须使用单独的版本吗? -fsanitize 标志仅允许地址或线程,但是否允许多个?

问候

最佳答案

不,不可能将 AddressSanitizer 和 ThreadSanitizer 组合到一个版本中(但其他组合也是可能的)。您需要多个构建

-fsanitize=address

Enable AddressSanitizer, a fast memory error detector. Memory access instructions are instrumented to detect out-of-bounds anduse-after-free bugs. The option enables-fsanitize-address-use-after-scope. See https://github.com/google/sanitizers/wiki/AddressSanitizer for moredetails. The run-time behavior can be influenced using theASAN_OPTIONS environment variable. When set to help=1, the availableoptions are shown at startup of the instrumented program. Seehttps://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flagsfor a list of supported options. The option cannot be combined with-fsanitize=thread or -fsanitize=hwaddress. Note that the only target -fsanitize=hwaddress is currently supported on is AArch64.

-fsanitize=thread

Enable ThreadSanitizer, a fast data race detector. Memory access instructions are instrumented to detect data race bugs. Seehttps://github.com/google/sanitizers/wiki#threadsanitizer for moredetails. The run-time behavior can be influenced using theTSAN_OPTIONS environment variable; seehttps://github.com/google/sanitizers/wiki/ThreadSanitizerFlags for alist of supported options. The option cannot be combined with-fsanitize=address, -fsanitize=leak.

Note that sanitized atomic builtins cannot throw exceptions when operating on invalid memory addresses with non-call exceptions(-fnon-call-exceptions).

https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

关于c++ - 是否可以将 AddressSanitizer 和 ThreadSanitizer 合并到一个版本中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68907684/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com