This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug testsuite/33394] New: Ad test case for Thread race segfault in std::string::append with -O and -s


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]