Cygwin 1.7 pthread hides segmentation fault

Howard Guo guohouzuo@gmail.com
Mon Jan 5 02:15:00 GMT 2015


It seems that segfaults go unreported using pthread and Cygwin 1.7.33-2.

Here is a minimal code piece to reproduce:

#include <pthread.h>

void* thread_run(void* _) {
        int *p = 0;
        *p = 1;
        return NULL;
}

int main(int argc, char** argv) {
        pthread_t t1;
        pthread_create(&t1, NULL, thread_run, NULL);
        pthread_join(t1, NULL);
        return 0;
}

Simply compiled with gcc -pthread, and the result executable returns 0
without reporting segmentation fault.

Could this be a bug?

Happy new year & regards,
Howard

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list