2 * Test program that triggers strcpy() from one thread and a memory allocation
3 * immediately after the region read by strcpy() from another thread. Without
4 * strcpy() intercept there is about 50% chance that this test program triggers
5 * a false positive race report on Ubuntu 12.10 amd64.
7 * See also https://bugs.kde.org/show_bug.cgi?id=326436.
25 ffList
.push_back((int *) NULL
);
26 for (list
<int*>::iterator ff
= ffList
.begin(); ff
!= ffList
.end(); ff
++) {
32 ffList
.push_back((int *) NULL
);
33 for (list
<int*>::const_iterator ff
= ffList
.begin(); ff
!= ffList
.end(); ff
++) {
43 subTest
= new SubTest();
44 setlocale(LC_ALL
, "English");
49 for (size_t i
= 0; i
< 10000; i
++) {
59 void *func1(void *instance
)
61 Test
*casted
= reinterpret_cast<Test
*>(instance
);
68 void *func2(void *instance
)
70 Test
*casted
= reinterpret_cast<Test
*>(instance
);
77 int main(int argc
, char* argv
[])
86 err
= pthread_create(&thread1
, NULL
, &func1
, &instance1
);
88 throw string("failed to create a thread.");
89 err
= pthread_create(&thread2
, NULL
, &func2
, &instance2
);
91 throw string("failed to create a thread.");
93 err
= pthread_join(thread1
, NULL
);
95 throw string("Thread::join(): failed to join.");
96 err
= pthread_join(thread2
, NULL
);
98 throw string("Thread::join(): failed to join.");