I also had this problem, but I use gdb in KDevelop quite rarely, which has not bothered me yet. Here my log is trying to fix it:
Grepping through the source code of GDB 7.3.1 shows that this message is printed when GDB tries to set its primary TTY to the newly created pseudo-tty (see gdb / inflow.c, lines 683-740). In particular, an ioctl call with a TIOCSCTTY request terminates with a permission error.
With that in mind, I looked at the source code of the Linux kernel to find out what might cause the crash. A bit of searching shows that it will eventually go into the tiocsctty () call. Comment by tiocsctty, which is important here:
Since the only reason it could fail with EPERM is because the tty created by GDB is actually the controlling tty for another process (which seems unlikely), I found it reasonable to assume that GDB is not a session leader. Fair enough, it was launched by KDevelop in the end!
So: I tried not to start the GDB session in the external terminal, and it works. The problem has narrowed.
An external terminal line was originally installed on the konsole --noclose --workdir %workdir -e %exe . Changing this parameter to terminator -e %exe has changed a bit: KDevelop warned me that
GDB cannot use the tty* or pty* devices. Check the settings on /dev/tty* and /dev/pty* As root you may need to "chmod ug+rw" tty* and pty* devices and/or add the user to the tty group using "usermod -G tty username".
I checked my rights; my user was part of the tty group, and all relevant files were read and write.
Grepping through the source code KDevelop shows how KDevelop actually installs the terminal. It runs a shell script
tty > FIFO_PATH ; trap "" INT QUIT TSTP ; exec<&-; exec>&-; while :; do sleep 3600;done
and then installs GDB to use the terminal device, which it reads from FIFO_PATH. (My name, by the way, is not the one that KDevelop uses.) The problem (as far as I can tell) is that gdb does not start as a child of the script shell and therefore cannot use it as the main tty.
I'm not going to fix KDevelop to make this work properly (or find what actually made it stop working in the first place ...), so the best I can offer at the moment is just don't use an external terminal for debugging goals.
Good luck I will update if I find anything useful.