Ubuntu 10.04 kernel 2.6.32-26-generic Netbeans 6.8 GDB 7.1-ubuntu Set Console type to Gnome terminal. FILE *input = NULL; input = fopen("/dev/tty","r"); returns NULL in debug mode (works fine in Run mode). How to re-produce: #include <termios.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> #include <sys/signal.h> #include <sys/types.h> main{ FILE *input = NULL; input = fopen("/dev/tty","r"); } In debug mode, fopen("/dev/tty","r"); return NULL. This bug may be related to Bug 11403 - Failed to set controlling terminal, as "/dev/tty" is the controlling terminal.