3

I would like to know -fsanitize=address option of gcc works with tcmalloc? or do we need to run by disabling tcmalloc? Or is it will be good if sanitizer is run enabling tcmalloc?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Nasir
  • 708
  • 2
  • 11
  • 28
  • I think both asan and tcmalloc want to replace the global malloc with their own version. What exactly are you hoping to achieve by mixing both? – Marc Glisse Mar 10 '17 at 14:59
  • @MarcGlisse I guess OP wants to avoid rewriting makefiles. – yugr Mar 10 '17 at 16:11

1 Answers1

1

Developers usually discourage from combining ASan with non-Glibc allocators (e.g. here) but theoretically there shouldn't be much difference - ASan is capable of intercepting any memory allocator on Linux (via symbol interposition).

yugr
  • 19,769
  • 3
  • 51
  • 96
  • Actually i am getting exact same dump as posted in the link you shared in comment above. Not sure what to do further – Nasir Mar 13 '17 at 13:34
  • @Nasir Frankly I'd expect tcmalloc developers to fix this issue but worst case you can simply disable tcmalloc in sanitized build (it's a standard practice to have small changes in checked builds to e.g. work around known limitations in checkers). – yugr Mar 13 '17 at 13:39
  • @Nasir One option is [reporting](https://github.com/google/sanitizers/issues/) this to Asan developers. You'd better [symbolize](http://tsdgeos.blogspot.co.uk/2014/03/asan-and-gcc-how-to-get-line-numbers-in.html) the stacktrace before reporting so that they can see what's going on. – yugr Mar 13 '17 at 13:41