Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
4998 Discussions

false positives in thread checker?

peter_schwer
Beginner
775 Views

Write -> Read data-raceMemory read at "stream.c":67 conflicts with a prior memory write at "_flsbuf.c":137 (flow dependence)

Write -> Write data-raceMemory write at "_open.c":198 conflicts with a prior memory write at "_getbuf.c":50 (output dependence)

Read -> Write data-raceMemory write at "_getbuf.c":50 conflicts with a prior memory read at "_open.c":198 (anti dependence)

I am using win32 threads, VC++ 6.0 on winxpsp2

I am seeing the above errors in the thread checker, all of which are related to the opening, writingand reading of files.All of the errors reference a call to "fgets" or "fopen" or "fprintf", but none of them are working on the same file, so I am confused why they would be occurring.

The output of my application is correct, but I want some assurance that these errors can be safely ignored. I think perhaps I am linking into a non-threadsafe library that is used for file operations?

Thank you for your assistance.

0 Kudos
1 Reply
Mark_D_Intel
Employee
775 Views

Which C runtime library are you linking with?

By default, VC6 links with a CRT that is not thread-safe. Use /MD, or /MDd (or /MT or /MTd) to link with a thread-safeCRT. This should remove these error messages that you are seeing.

0 Kudos
Reply