oneapi-src / oneTBB

oneAPI Threading Building Blocks (oneTBB)
https://oneapi-src.github.io/oneTBB/
Apache License 2.0
5.57k stars 1.01k forks source link

Using LLVM compiler-rt for tbbmalloc_proxy? #188

Open e4lam opened 4 years ago

e4lam commented 4 years ago

On the Microsoft C++ Team Blog, there's a new article [1] that mentions MS contributing bug fixes and improved interception for memory allocations functions to the LLVM compiler-rt project [2].

Given the frequent tbbmalloc_proxy problems we have with new Windows 10 updates and tbbmalloc_proxy, it might be useful for TBB to consider join forces with compiler-rt for hooking allocators.

  1. https://devblogs.microsoft.com/cppblog/addresssanitizer-asan-for-windows-with-msvc/
  2. https://github.com/llvm/llvm-project/tree/main/compiler-rt

I toook a quick look and the code seems to be in this file here: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/asan/asan_malloc_win.cpp (look for ReplaceSystemMalloc())

e4lam commented 4 years ago

PS. The interception code on Windows is pretty interesting here as well: https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/interception/interception_win.cpp

anton-potapov commented 2 years ago

@e4lam, links no longer works :(

e4lam commented 2 years ago

@anton-potapov I've updated the links in the description above. They renamed the "master" branch to "main" so I just needed to substitute "master" for "main" in the URLs.