Traceback of hanged process

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hynek Hanke

    #1

    Traceback of hanged process


    Hello,

    please, how do I create a pythonic traceback from a python process that
    hangs and is not running in an interpreter that I executed manually
    or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
    implemented in Python, so I need some analog of 'gdb attach' for C.

    Unfortunatelly, googling and reading documentation revealed nothing, so
    please excuse if this question is dumb.

    Thank you,
    Hynek Hanke


  • Gabriel Genellina

    #2
    Re: Traceback of hanged process

    On 6 ene, 19:45, Hynek Hanke <h...@brailcom. orgwrote:
    please, how do I create a pythonic traceback from a python process that
    hangs and is not running in an interpreter that I executed manually
    or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
    implemented in Python, so I need some analog of 'gdb attach' for C.
    On Windows, Pythonwin has an option "Break into running code".
    Try starting the script with python -i, and send it a signal..

    --
    Gabriel Genellina

    Comment

    • Klaas

      #3
      Re: Traceback of hanged process

      Hynek Hanke wrote:
      Hello,
      >
      please, how do I create a pythonic traceback from a python process that
      hangs and is not running in an interpreter that I executed manually
      or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
      implemented in Python, so I need some analog of 'gdb attach' for C.
      >
      Unfortunatelly, googling and reading documentation revealed nothing, so
      please excuse if this question is dumb.
      In python2.5, you can run a background thread that listens on a port or
      unix socket, and prints a formatted version of sys._current_fr ames() to
      stderr.

      -Mike

      Comment

      • Mike C. Fletcher

        #4
        Re: Traceback of hanged process

        Klaas wrote:
        Hynek Hanke wrote:
        >
        >Hello,
        >>
        >please, how do I create a pythonic traceback from a python process that
        >hangs and is not running in an interpreter that I executed manually
        >or it is but doesn't react on CTRL-C etc? I'm trying to debug a server
        >implemented in Python, so I need some analog of 'gdb attach' for C.
        >>
        ....
        In python2.5, you can run a background thread that listens on a port or
        unix socket, and prints a formatted version of sys._current_fr ames() to
        stderr.
        >
        You can also use the signal module to similar effect. Works well in
        Twisted, at least:



        HTH,
        Mike

        --
        _______________ _______________ _______________ ___
        Mike C. Fletcher
        Designer, VR Plumber, Coder



        Comment

        Working...