Re: NPTL static link CORE DUMP

From: Thanapol Rojanapanpat (thanapol_r_at_yahoo.com)
Date: 12/05/03

  • Next message: Benjamin J. Weiss: "Re: [SOLVED (sort of)] Need help from an X guru!"
    To: redhat-list@redhat.com
    Date: Fri, 5 Dec 2003 05:08:34 -0800 (PST)
    
    

    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

    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Benjamin J. Weiss: "Re: [SOLVED (sort of)] Need help from an X guru!"

    Relevant Pages

    • Re: HPGCC Questions ladies and gentlemen!!!
      ... :> how to compile it, and that means learning how to use the tools. ... Where did you get the gcc package for windows from? ... :> bit looking for bugs in their beginer level programs with the use of printf ... What kind of program written by beginner is going to "crash"? ...
      (comp.sys.hp48)
    • RE: Console Application Testing
      ... vbc.exe could be accessed in Visual Studio Command ... If you want to compile the project in command prompt with vbc.exe, ... Microsoft Online Community Support ...
      (microsoft.public.dotnet.languages.vb)
    • Re: Macro prompt
      ... I'm sorry, Pcman, I don't think I can help here. ... If you want to test the action of clicking a command button on a form, I suggest you test it by clicking the command button on the form, not by trying to run the Click event code from within the VBE window. ... Steve Schapel, Microsoft Access MVP ... options pop-up menu the the "Compile" section has already checked off Compile ...
      (microsoft.public.access.macros)
    • Re: Using MATLAB functions in C code
      ... interface to MATLAB engine.When I tried to ... option files needed.The command is as follows: ... MATLAB fft amd ifft functions.I just want to compile them like: ... int mlhs, mrhs; ...
      (comp.soft-sys.matlab)
    • Re: Compile simple C# example in Web Matrix
      ... To compile the simple howdy, cs one would do the following: ... Run | Command Prompt ... I did as intructed and downloaded the SDK and read through the ... >> public class HowdyPartner ...
      (microsoft.public.dotnet.framework.aspnet)