|
From: Bart V. A. <bar...@gm...> - 2009-10-10 08:07:33
|
On Fri, Oct 9, 2009 at 1:54 PM, Brian Modra <br...@zw...> wrote:
> in my Open Source project, The Karoo Project, I was rigorously testing
> using helgrind, and consistently got a report of a possible race
> condition in pthread_create. This seemed strange, and I checked out
> the address it was reporting, which turned out to be a variable
> allocated on the stack inside the call to pthread_create, or in a
> function it called inside the pthreads library.
>
> So I created a test program which does reproduce the same race
> condition waring. (Attached)
> To compile and test:
> gcc -o z z.c -lpthread
> valgrind --tool=helgrind ./z
>
> Note that if I don't pass the pointer to the element in the data
> array, then there is no race condition reported.
> But this memory is not written or read anywhere in my program.
>
> I wonder if anyone else has experienced this... I need to work out if
> this is a valgrind bug, or a pthreads bug, or am I missing something?
The race reported by Helgrind might be one of the benign races
triggered by the NPTL during thread creation.
As you can see in glibc-2.34567-NPTL-helgrind.supp this file already
contains the following suppression pattern:
{
helgrind-glibc2X-109
Helgrind:Race
fun:start_thread
}
What you can do is to add a suppression pattern for the output you
posted, create a bug report and include the new suppression pattern in
your bug report.
Bart.
|