title: Why is gdb throwing internal errors and telling me that there is a bug?
body: <p>I'm trying to debug a simple program but gdb is acting up. I get internal errors and then gdb saying that there's a bug. This happens when I try to stop the running program. After sending Keyboard Interrupt to go back to the debugger, I try to exit the whole debugger with <code>quit</code>. But when I do that, I get this (I also include what happens when I go through the questions):</p>
  <pre><code>A debugging session is active.
  
      Inferior 1 [process 1239] will be killed.
  
  Quit anyway? (y or n) y
  ../../gdb/target.c:2149: internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Quit this debugging session? (y or n) y
  
  This is a bug, please report it.  For instructions, see:
  &lt;https://www.gnu.org/software/gdb/bugs/&gt;.
  
  ../../gdb/target.c:2149: internal-error: void target_mourn_inferior(ptid_t): Assertion `ptid == inferior_ptid' failed.
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Create a core file of GDB? (y or n) y
  Abort trap: 6 (core dumped)
  </code></pre>
  <p>Can someone tell me what is going on, why it's happening, and how to fix it please?</p>