Public bug reported:
Binary package hint: valgrind
I have Ubuntu 10.04 with Valgrind 3.6.0~svn20100212-0ubuntu5. I created
a simple test program like this
#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
static void *func(void *a)
{
a = NULL;
while (1) {
sleep(1);
}
return NULL;
}
int main()
{
pthread_t trd;
if (pthread_create(&trd, NULL, func, NULL)) {
exit(1);
}
pthread_detach(trd);
sleep(60);
return 0;
}
but I get an error when running the helgrind
# gcc -Wall vgtest.c -lpthread
# valgrind --trace-children=yes --verbose --tool=helgrind ./a.out
...
==13694== Thread #2 was created
==13694== at 0x513365E: clone (clone.S:77)
==13694== by 0x4E37172: pthread_create@@GLIBC_2.2.5 (createthread.c:75)
==13694== by 0x4C2C42C: pthread_create_WRK (hg_intercepts.c:230)
==13694== by 0x4C2C4CF: pthread_cre...@* (hg_intercepts.c:257)
==13694== by 0x4006B6: main (in /var/tmp/a.out)
==13694==
==13694== Thread #1 is the program's root thread
==13694==
==13694== Possible data race during write of size 8 at 0x7ff0009e0 by thread #2
==13694== at 0x4C2C54C: mythread_wrapper (hg_intercepts.c:200)
==13694== This conflicts with a previous read of size 8 by thread #1
==13694== at 0x4C2C440: pthread_create_WRK (hg_intercepts.c:235)
==13694== by 0x4C2C4CF: pthread_cre...@* (hg_intercepts.c:257)
==13694== by 0x4006B6: main (in /var/tmp/a.out)
==13694==
I also tried with the SVN version (11112) and it works correctly. Please update
the Ubuntu package...
** Affects: valgrind (Ubuntu)
Importance: Undecided
Status: New
--
Valgrind's thread checker not working correctly
https://bugs.launchpad.net/bugs/571577
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs