gcc 地址消毒剂拦截器_via_fun

8xiog9wr  于 2022-11-24  发布在  其他
关注(0)|答案(2)|浏览(135)

希望抑制AddressSanitizer检测到的以下错误。

==114064==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffe60fee2f0 at pc 0x000001e6ef34 bp 0x7ffe60feb6c0 sp 0x7ffe60feb6b8
WRITE of size 8 at 0x7ffe60fee2f0 thread T0
    #0 0x1e6ef33 in std::_Function_base::_Function_base() /opt/gcc-8.2.0/include/c++/8.2.0/bits/std_function.h:252
    #1 0x1e6ef33 in function<Engine::Engine(const Resource&, SourceDataVersion, Engine::CalculationResolution)::<lambda(std::unique_ptr<const model::Car>)> > /opt/gcc-8.2.0/include/c++/8.2.0/bits/std_function.h:668
    ...

我想设置ASAN_OPTIONS=suppressions=asan_blacklist. txt,其中包含

interceptor_via_fun:_Function_base

就像文档中说的那样

interceptor_via_fun:NameOfCFunctionToSuppress

但事实并非如此。我非常震惊地看到,在谷歌上搜索“AddressSanitizer interceptor_via_fun”只返回了151个结果。:/

我应该在抑制档中放入什麽?

8yparm6h

8yparm6h1#

https://github.com/google/sanitizers/issues/1027#issuecomment-1147125536 has an explanation. Also, you're using a lambda and functor here, which may not be supported

v440hwme

v440hwme2#

你没试过这本llvm手册吗?
并添加以下行以禁止外部库
interceptor_via_lib:要隐藏的库的名称

相关问题