title: Why would gdb hang?
body: <p>I have an application that I am debugging and I'm trying to understand how gdb works and why I am not able to step through the application sometimes.  The problem that I am experiencing is that gdb will hang and the process it is attached to will enter a defunct state when I am stepping through the program.  After gdb hangs and I have to kill it to free the terminal (ctrl-C does not work, I have to do this from a different terminal window by getting the process id for that gdb session and using kill -9).</p>
  
  <p>I'm guessing that gdb is hanging because it's waiting for the application to stop at the next instruction and somehow the application finished execution without gdb identifying this.  But that's just speculation on my part from the behavior I've observed thus far.  So my question is if anyone has seen this type of behavior before and/or could suggest what the cause might be.  I think that might help me improve my debugging strategy.</p>
  
  <p>In case it matters I'm using g++ 4.4.3, gdb 7.1, running on Ubuntu 10.04 x86_64.</p>