This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug testsuite/33394] New: Ad test case for Thread race segfault in std::string::append with -O and -s
- From: "appfault at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Sep 2007 16:39:18 -0000
- Subject: [Bug testsuite/33394] New: Ad test case for Thread race segfault in std::string::append with -O and -s
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This is dependant on bug 32261.
g++ -g -O3 gccbug.cpp -pthread -o gccbug -s
#include <pthread.h>
#include <string>
void* thread_function(void*) {
for (int k = 0; k < 50000; k++) {
std::string my_str;
my_str += "foo";
}
return 0;
}
int main()
{
pthread_t thread1, thread2;
pthread_create(&thread1, NULL, thread_function, NULL);
pthread_create(&thread2, NULL, thread_function, NULL);
void* exitcode;
pthread_join(thread1, &exitcode);
pthread_join(thread2, &exitcode);
return 0;
}
--
Summary: Ad test case for Thread race segfault in
std::string::append with -O and -s
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: testsuite
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: appfault at hotmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33394