title: Debugging non-responsive python/PyQt application in PyCharm
body: <p>How do you go about debugging a non-responsive python/PyQt application in PyCharm?</p>
  
  <p>I am an experienced programmer, but new to all thing python.  I have been given a large application (36,000 lines), which works under Windows, to port to Linux.</p>
  
  <p>Having made just a handful of changes for OS-specific stuff, when I run the application it comes up with its main window.  But then after a few seconds it becomes dimmed, and when I close the window I am asked to confirm to end "the window is not responding".</p>
  
  <p>(Aside: On a whim I decided to try running the app via <code>sudo</code>, and surprisingly it works fine.  I have tried doing <code>strace</code> running as root versus non-root, but I'm fairly sure there is nothing obvious in the way of file accesses/permissions etc. that differs.  This may be a clue, but just as likely to be a red-herring, e.g. if it's an "uninitialized variable".)</p>
  
  <p>If I debug it inside PyCharm, at that point I expect to click the "Pause Program" button, so that I can get a trace back and begin to see where it is in the code, and start stepping or whatever.  However, that button does nothing at this stage?  Maybe it only "works" when on "a python instruction"?</p>
  
  <p>If I force a core dump (from the keyboard) and examine with <code>gdb</code>, I can see that the stack frame shows it is way down inside <code>libQtCore</code>/<code>libQtGui</code>, in <code>processEvents</code> on a call to <code>read</code>.</p>
  
  <p>So how do I begin to go about debugging why it is (presumably) busy doing something at this point, or at least not responding?  Any tips would be welcome.  I do hope this question will not fall foul of SO's "too general" policy, any tips to get someone going on debugging a "non-responsive" program would be welcome.</p>