jjzjj

ThreadSanitizer

全部标签

c++ - Windows 的 ThreadSanitizer 日期竞赛测试

谁知道ThreadSanitizer?有没有人在windows(xp)上使用这个工具?我从here下载最新版本.我为VS2008编写了测试应用程序(使用单个printf("hello");)并编译它。然后tsan.bat--log-file=logTasn.txt--color--debug\test.exe看看Theapplicationfailedtoinitializeproperly(0xc0000005).ClickonOKtoterminatetheapplication.=(控制台中没有任何描述。而且我在goolge中找不到任何相关信息=(有没有人有同样的问题?或者有人可

c++ - ThreadSanitizer FATAL 运行时异常

我一直在努力让ThreadSanitizer与我拥有的gcc版本(4.8.2)一起工作,所以我采用了他们的简单示例:#include#include#include#includetypedefstd::mapmap_t;void*threadfunc(void*p){map_t&m=*(map_t*)p;m["foo"]="bar";return0;}intmain(){map_tm;pthread_tt;pthread_create(&t,0,threadfunc,&m);printf("foo=%s\n",m["foo"].c_str());pthread_join(t,0);}

c++ - Thread Sanitizer 是否可用?

我想尝试线程清洁剂(http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Using_ThreadSanitizer)所以我做了一个简单的程序:#include#include#include#include#include#includeusingnamespacestd;intviolated=0;mutexmtx;voidviolator(){lock_guardlg(mtx);violated++;}intmain(){threadt1(violator);t1.join();threadt2(violator

c++ - ThreadSanitizer 在使用嵌入式引用计数器时报告 "data race on operator delete(void*)"

请看下面的代码:#include#includeclassReferenceCounted{public:ReferenceCounted():ref_count_(1){}voidreserve(){ref_count_.fetch_add(1,boost::memory_order_relaxed);}voidrelease(){if(ref_count_.fetch_sub(1,boost::memory_order_release)==1){boost::atomic_thread_fence(boost::memory_order_acquire);deletethis;}}

c++ - 使用 clang 的 ThreadSanitizer 和 TBB 避免误报

有没有人试过clang'sThreadSanitizer与IntelThreadingBuildingBlocks(TBB)?到目前为止,我的经验是您会收到很多警告,即使对于相对简单的示例也是如此。不幸的是,其中许多似乎是误报。在thisanswer对于另一个ThreadSanitizer问题,建议使用抑制文件。这有帮助吗?是否有针对TBB或任何其他技术的抑制文件?(旁注:使用Helgrind,它看起来很相似。许多误报。) 最佳答案 当我在TSAN_OPTIONS中引用抑制文件时,我才让它工作。至少对我而言,仅在编译期间使用-fsa