Pthread在ARMv7 NetBSD5.1目标中不工作

Pthread在ARMv7 NetBSD5.1目标中不工作,arm,pthreads,netbsd,Arm,Pthreads,Netbsd,我已经编译了一个简单的pthread_create程序,并在ARMv7目标(cortex a9 CPU)上的NetBSD5.1中执行了相同的程序 程序出现故障。相同的pthread程序正在另一台PC上运行,没有任何问题 下面是示例程序 void *PrintHello(void *threadid){ long tid, i; tid = (long)threadid; for (i=0; i<PRINT_REPEAT; i++) { printf(

我已经编译了一个简单的pthread_create程序,并在ARMv7目标(cortex a9 CPU)上的NetBSD5.1中执行了相同的程序

程序出现故障。相同的pthread程序正在另一台PC上运行,没有任何问题

下面是示例程序

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);
}
void*PrintHello(void*threadid){
长tid,我;
tid=(长)线程ID;

对于(i=0;i以下是我收到的调用堆栈。加载了/usr/libexec/ld.elf_so(gdb)bt#0 0x4003ad64的符号,该符号来自/usr/lib/libpthread.so.0#1 0x400af724 in inet_network(),来自/usr/lib/libc.so.12,来自/usr/lib/libc.so.12,来自inet#network()中的0x400af724(损坏的堆栈?)您使用NetBSD 5.1的任何原因?NetBSD 5.1不再受支持,NetBSD 7.0和6.1是当前受支持的版本。在“PC”上运行的是什么操作系统和版本?NetBSD5.1是正在运行的操作系统。我之所以使用它,是因为这台计算机已经启动并正在运行。我正在尝试添加pthread库。以下是我收到的调用堆栈。已从inet_网络中的/usr/libexec/ld.elf_so(gdb)加载pthread_setcancelstate()中的/usr/lib/libpthread.so.0#1 0x400af724的符号()从inet_网络中的/usr/lib/libc.so.12#2 0x400af724()从/usr/lib/libc.so.12上一个与此帧相同的帧(损坏的堆栈?)我还尝试了使用-static linker选项编译相同的C程序,并在uu flockfile_internal()(gdb)bt中获得了下面的回溯0x0002335c#1 0x00022b88在fflush()中#2 0x00022b88在fflush()中你使用NetBSD 5.1的任何原因?NetBSD 5.1不再受支持,NetBSD 7.0和6.1是当前受支持的版本。“PC”上运行的是什么操作系统和版本?NetBSD5.1是正在运行的操作系统。我使用它是因为这台机器已经启动并正在运行。我正在尝试添加pthread库。