I have compiled a simple pthread_create program and executed the same in NetBSD5.1 on ARMv7 target(cortex a9 CPU).
the program sigfaults. The same pthread program is running in another PC without any issue.
Below is the sample program
void *PrintHello(void *threadid){
long tid, i;
tid = (long)threadid;
for (i=0; i<PRINT_REPEAT; i++) {
printf("Hello World! It's me, thread #%ld!\n", tid);
};
pthread_exit(NULL);
}
int main (int argc, char *argv[])
{
pthread_t threads[NUM_THREADS];
int rc;
int t;
printf("PrintHello is %p\r\n",(void *)PrintHello);
for(t=0; t<NUM_THREADS; t++){
rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
if (rc){
printf("ERROR; return code from pthread_create() is %d\n", rc);
}
}
pthread_exit(NULL);
}
Any pointers on this would be very helpful. I am seeing that the data_abort_handler exception is being raised on executing the program.