On Fri, Oct 9, 2009 at 1:54 PM, Brian Modra <br...@zwartberg.com> 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.

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to