I have some piece of code that is causing an error when it's run with Thread Sanitizer on:
bool Renderer::render(std::optional cancellationToken) {
const RenderWatcher renderWatcher{cancellationToken};
...
return Render(...
…
I am making a library for a c++ cmake executable application. In this library I want to be able to call julia functions as shown in this example. To do this I have downloaded the Julia linux binaries from here, which includes the executable…
I'm thread-analyzing using ThreadSanitizer, and I'm getting a warning that's very, very confusing to my understanding on how mutexes work. I'm using gcc 6.3 on Debian Stretch.
In a class, at one thread, I have:
auto MyPtr =…
Performance aside, what features does gcc -fsanitize=thread lack that are supported by valgrind --tool=helgrind, and vice-versa? Is it platform-dependent?
Which detects the most critical errors? I would like to use only one if I can, since gcc…
I have some weird multithreading bugs, so I wanted to use the gcc thread sanitizer to find them. However, when I compile with -sanitize=thread the resulting binary segfaults immediatly with the following stacktrace:
#0 0x0000000000000000 in ??…
I am having a problem with Gcc's thread sanitizer that I cannot find on their bugzilla or on stackoverflow so I am unsure if I am missing something or if this really is a bug. If I create a main.cpp file containing:
#include
int main(){
…
The code snippet below is a minimal example of a pattern we use in our production code for doing asynchronous work. When a thread has been spawned, we want to make sure at some point that the work it was meant to do has been completed. We always…
I found a data race in my Swift app by using the Thread Sanitizer, and so I made my first attempt to fix race conditions by converting the offending class to an actor. The crash that the race was causing seems to have gone away, but Thread Sanitizer…
My goal is to instrument my initial IR with proper calls to TSan runtime library functions using LLVM opt tool and TSan passes. In other words, I want to end up with similar TSan instrumentation as when using clang -fsanitize=thread -S but by…
I want to disable ASan and TSan checks for one method in a project and the option llvm provides is a Sanitizer special case list.
Here is a small example code which triggers an AddressSanitizer error.
#include
#include
class…
I'd like to test data races in C++ on windows 10(64 bit), but it seems that Visual C++ doesn't support it yet.
So, I installed Cygwin and got g++ 11.2.0, tried compiling my C++ code with -fsanitize=thread -fPIE -pie -g, but it failed with -ltsan not…
I am trying to build my project and run an executable in a different machine where I can see thread related issues (if exist). I am using VS2019 and providing -fsanitize=thread -fPIE -pie -g options in the Configuration…
func doSomething() -> Int {
var sum = 0
let increaseWork = DispatchWorkItem {
sum = sum + 100 //point 1
}
DispatchQueue.global().async(execute:increaseWork)
increaseWork.wait()
return sum //point 2
}
Thread Sanitizer…
When I run code that calls notify_all_at_thread_exit() from a detached thread, tsan complains about a data race between pthread_cond_broadcast and pthread_cond_destroy. Am I doing something wrong? Or is this a false positive from tsan?
#include…
I am trying to use threadsanitizer on given piece of code(in ok.c file) as:
clang -fsanitize=thread ok.c -w -I../runtime
This works fine and no data race is detected, but when I try giving -fopenmp option to sanitizer it dumps the terminal with…