My script use paramiko module, it will be blocked at compute_hmac

Discussion in 'Python' started by Jack, Feb 23, 2013.

  1. Jack

    Jack Guest

    Hello
    one problem, thanks for help

    My script like this:
    /hostname = xxx//
    //username = xxx//
    //password = xxx//
    //t = paramiko.Transport((hostname, 22))//
    //t.connect(username=username, password=password)//# here will be blocked
    //sftp = paramiko.SFTPClient.from_transport(t)/

    I used gdb attach the python process, found that:
    /(gdb) py-bt
    #2 <built-in function sleep>
    #4 file '/usr/lib64/python2.6/threading.py', in 'wait'
    #8 file '/usr/lib64/python2.6/threading.py', in 'wait'
    #12 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/auth_handler.py',
    in 'wait_for_response'
    #15 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
    in 'auth_password'
    #19 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
    in 'connect'
    #23 file 'plugins.py', in '<module>'
    #35 file '<stdin>', in '<module>'
    (gdb) info threads
    2 Thread 0x7fe956708700 (LWP 25635) 0x0000003806e0d720 in sem_wait ()
    from /lib64/libpthread.so.0
    * 1 Thread 0x7fe96163b700 (LWP 25615) 0x00000038066e0d03 in select ()
    from /lib64/libc.so.6
    (gdb) thread 2
    [Switching to thread 2 (Thread 0x7fe956708700 (LWP 25635))]#0
    0x0000003806e0d720 in sem_wait () from /lib64/libpthread.so.0
    (gdb) py-bt
    #1 Waiting for a lock (e.g. GIL)
    #7 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
    in 'compute_hmac'
    #10 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
    in 'read_message'
    #13 file
    '/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
    in 'run'
    #16 file '/usr/lib64/python2.6/threading.py', in '__bootstrap_inner'
    #19 file '/usr/lib64/python2.6/threading.py', in '__bootstrap'
    /
    *but it is strange that when I use python interactive shell, the code
    works well*

    Regards,
    Jack
     
    Jack, Feb 23, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Greg Lindstrom

    Using Paramiko

    Greg Lindstrom, Apr 19, 2005, in forum: Python
    Replies:
    0
    Views:
    484
    Greg Lindstrom
    Apr 19, 2005
  2. Rich Burridge
    Replies:
    0
    Views:
    459
    Rich Burridge
    Jul 25, 2006
  3. Jean-Paul Calderone

    Re: Python stack trace on blocked running script.

    Jean-Paul Calderone, Jul 25, 2006, in forum: Python
    Replies:
    0
    Views:
    678
    Jean-Paul Calderone
    Jul 25, 2006
  4. Omar Abid

    Script Blocked !

    Omar Abid, Jun 12, 2007, in forum: HTML
    Replies:
    4
    Views:
    357
    Travis Newbury
    Jun 13, 2007
  5. Mark
    Replies:
    9
    Views:
    142
Loading...

Share This Page