Hi,
I get the following race from DRD:
Conflicting store by thread 7 at 0x55fe8aa0 size 8
by 0x5CCD8750: func() (inv_utils.C:1711)
by 0x4C2C0C1: ??? (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x5047F04: start_thread (in /lib64/libpthread-2.14.1.so)
by 0x5CB710C: clone (in /lib64/libc-2.14.1.so)
Address 0x55fe8aa0 is at offset 0 from 0x55fe8aa0. Allocation context:
at 0x4C2BC9D: malloc (in
/usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x5CCD849F: func() (inv_utils.C:1690)
by 0x4C2C0C1: ??? (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x5047F04: start_thread (in /lib64/libpthread-2.14.1.so)
by 0x5CB710C: clone (in /lib64/libc-2.14.1.so)
Other segment start (thread 6)
at 0x4C31712: pthread_spin_lock (in
/usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x22C031FD: hunc (bn_thread.C:43)
by 0x4C2C0C1: ??? (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x5047F04: start_thread (in /lib64/libpthread-2.14.1.so)
by 0x5CB710C: clone (in /lib64/libc-2.14.1.so)
Other segment end (thread 6)
at 0x4C30EC2: pthread_spin_init (in
/usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x22C032AD: hunc (bn_thread.C:47)
by 0x4C2C0C1: ??? (in /usr/lib64/valgrind/vgpreload_drd-amd64-linux.so)
by 0x5047F04: start_thread (in /lib64/libpthread-2.14.1.so)
by 0x5CB710C: clone (in /lib64/libc-2.14.1.so)
The function func() is in essence:
{
int * data = malloc(100);
for (int i = 0; i != 100; ++i) {
data[i] = 0; <------- Line 1711
}
// Some small calculations
free(data);
}
So I wonder how there can be a data race for writting to data. The
memory has been just allocated and no other thread knows about it.
How can this happen?
Thanks
Christoph
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users