Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are ways to detect race conditions on Linux?

What tools have you used to detect race conditions for multithreaded programs in Linux.

I use the helgrind tool from valgrind, but I've noticed that sometimes it misses race conditions.

like image 921
MetallicPriest Avatar asked Oct 28 '25 11:10

MetallicPriest


2 Answers

You may want to try ThreadSanitizer.

It differs from Helgrind in that in hybrid mode it "may give more false positives, but is much faster, more predictable and finds more real races."

like image 95
Employed Russian Avatar answered Oct 30 '25 02:10

Employed Russian


You can also use DRD Valgrind tool along with helgrind. Though I have not tried DRD, it should detect some bugs missed by helgrind - so it worth to use both tools to detect more bugs.

like image 38
ks1322 Avatar answered Oct 30 '25 01:10

ks1322