Community
cancel
Showing results for 
Search instead for 
Did you mean: 
peter_schwer
Beginner
71 Views

false positives in thread checker?

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
71 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.

Reply