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 quit. But when I do that, I get this (I also include what happens when I go through the questions):
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:
<https://www.gnu.org/software/gdb/bugs/>.
../../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)
Can someone tell me what is going on, why it's happening, and how to fix it please?