Re: NPTL static link CORE DUMP

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

 



Hello,

I try to test this program.

mythread.c

======

#include <stdio.h>

#include <pthread.h>

void* mythread (void *arg) {

int a = *(int *)arg;

printf ("thread %d start\n", a);

return ((void *)0);

}

int main (int argc, char **argv) {

pthread_t t[100];

for (int i=0; i<100; i++) {

  pthread_create (&t[i], NULL, &mythread, (void *)&i);

}

for (int i=0; i<100; i++) {

  pthread_join (t[i], NULL);

}

return 0;

}

=======

I compile by using this command

"gcc -o mythread -static -I/usr/include/nptl -I/usr/include -L/usr/lib/nptl -L/usr/lib mythread.c -lpthread"

I run it under GDB, but I don't know where it is error. It generates core dump before execute main function.

I need all of your help.

Thanks

Thanapol R.




Do you Yahoo!?
Free Pop-Up Blocker - Get it now

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux