17

Would like to suppress the following error detected by 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
    ...

I was thinking setting ASAN_OPTIONS=suppressions=asan_blacklist.txt, with asan_blacklist.txt containing

interceptor_via_fun:_Function_base

would do the trick, as the documentation says

interceptor_via_fun:NameOfCFunctionToSuppress

but it doesn't. Was quite shocked to see that googling "AddressSanitizer interceptor_via_fun" returned only 151 results. :/

What should I put in my suppression file?

joaerl
  • 1,012
  • 1
  • 10
  • 21

2 Answers2

0

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

Alex E
  • 149
  • 9
-3

Didn't you try this llvm manual?

And add following line to suppress your external library

interceptor_via_lib:NameOfTheLibraryToSuppress