NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-arm/50788: Pthread sigfaults on ARMv7 NetBSD5.1



>Number:         50788
>Category:       port-arm
>Synopsis:       Pthread sigfaults on ARMv7 NetBSD5.1
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    port-arm-maintainer
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 09 05:45:00 +0000 2016
>Originator:     Zaid
>Release:        NetBSD5.1 stable
>Organization:
Aricent
>Environment:
NetBSD  5.1_STABLE evbarm
>Description:
1. 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);
}


Following is the call stack I have received.

Loaded symbols for /usr/libexec/ld.elf_so
(gdb) bt
#0  0x4003ad64 in pthread_setcancelstate () from /usr/lib/libpthread.so.0
#1  0x400af724 in inet_network () from /usr/lib/libc.so.12
#2  0x400af724 in inet_network () from /usr/lib/libc.so.12
Previous frame identical to this frame (corrupt stack?)


I have also tried the compiling the same C program with -static linker option and got the below backtrace

0x0002335c in __flockfile_internal ()
(gdb) bt
#0  0x0002335c in __flockfile_internal ()
#1  0x00022b88 in fflush ()
#2  0x00022b88 in fflush ()


Any pointers on this would be very helpful. I am seeing that the data_abort_handler exception is being raised on executing the program.
>How-To-Repeat:
1. Compile and execute any pthread program in ARMv7 NetBSD5.1 target
>Fix:



Home | Main Index | Thread Index | Old Index