title: GDB internal error when using clone()
body: <p>I'm working on Ubuntu 12.04 and debugging the below code using gdb. I get the following internal error whenever calling <code>clone()</code>.</p>
  
  <pre><code>34      pid = clone(entryPt,(char*)pStack+stackSize,SIGCHLD|CLONE_FS|CLONE_FILES|CLONE_VM,&amp;arg);
  (gdb) n
  /build/buildd/gdb-7.4-2012.04/gdb/linux-thread-db.c:418: internal-error: thread_get_info_callback: Assertion `inout-&gt;thread_info != NULL' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Quit this debugging session? (y or n)
  </code></pre>
  
  <p>Here is the code segment.</p>
  
  <pre><code>int taskSpawn(char* name, int priority, int option, int stackSize, FUNCPTR entryPt, int arg)
  {
      TblEntry            *Task_Entry;
      int                 Handle, q_idx, old_idx, old_priority;
      void                *pStack;
      pid_t               pid = 0; // to be modified.
      struct _Task        *new_TCB, *old_TCB;
      /* Get a free entry */
      Handle  =   _CreateHandle(&amp;Task_Entry);
  
      if( Handle == -1 )
          return -1; // fail to spawn task.
  
      pStack = malloc(stackSize);
      // Call clone().
  #ifdef __linux
      pid = clone(entryPt,
                  (char*)pStack+stackSize,
                  SIGCHLD|CLONE_FS|CLONE_FILES|CLONE_VM,
                  &amp;arg);
      kill(pid, SIGSTOP);
      printf("clone returns %d\n", pid);
  
      if(pid &lt; 0)
      {
          exit(0);
      }
  
  #endif
  return 0;
  }
  </code></pre>
  
  <p>why does <code>clone()</code> give me this error?<br>
  Thank you in advance.</p>