This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python hangs forever in wait() of threading.py
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 2.7
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: appidman, iritkatriel, r.david.murray
Priority: normal Keywords:

Created on 2015-04-22 14:17 by appidman, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
gdb.txt appidman, 2015-04-22 14:17
Messages (4)
msg241806 - (view) Author: appidman (appidman) Date: 2015-04-22 14:17
I use paramiko to create SSH sessions to Linux machines, which works great 95% of the time. But sometimes, the Python process which creates the SSH session hangs forever in wait() of threading.py (see attachment 'gdb.txt' for full output).

{code}
(gdb) py-list
 239            waiter.acquire()
 240            self.__waiters.append(waiter)
 241            saved_state = self._release_save()
 242            try:    # restore state no matter what (e.g., KeyboardInterrupt) 
 243                if timeout is None:
>244                    waiter.acquire()
 245                    if __debug__:
 246                        self._note("%s.wait(): got it", self)
 247                else:
 248                    # Balancing act:  We can't afford a pure busy loop, so we
 249                    # have to sleep; but if we sleep the whole timeout time,


(gdb) py-bt
#5 Frame 0xb459a5c, for file /usr/lib/python2.7/threading.py, line 244, in wait (self=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0xaf7e3a0>, acquire=<built-in method acquire of thread.lock object at remote 0xaf7e3a0>, _Condition__waiters=[<thread.lock at remote 0xaf7e100>], release=<built-in method release of thread.lock object at remote 0xaf7e3a0>) at remote 0xb73708c>, timeout=None, waiter=<thread.lock at remote 0xaf7e100>, saved_state=None)
    waiter.acquire()
#9 Frame 0xb66118c, for file /usr/lib/python2.7/dist-packages/paramiko/buffered_pipe.py, line 137, in read (self=<BufferedPipe(_closed=False, _lock=<thread.lock at remote 0xaf7e3a0>, _buffer=<array.array at remote 0xb737ea0>, _event=None, _cv=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0xaf7e3a0>, acquire=<built-in method acquire of thread.lock object at remote 0xaf7e3a0>, _Condition__waiters=[<thread.lock at remote 0xaf7e100>], release=<built-in method release of thread.lock object at remote 0xaf7e3a0>) at remote 0xb73708c>) at remote 0xb737a4c>, nbytes=8192, timeout=None, out='', then=<float at remote 0xb57efe4>)
    self._cv.wait(timeout)
{code}
msg241809 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-04-22 15:08
This could easily be a programming error.  We'd need a cut down reproducer to know if it is a python bug and be able to fix it if so.  Have you reported this to paramiko?
msg241929 - (view) Author: appidman (appidman) Date: 2015-04-24 09:10
I created a issue for paramiko: https://github.com/paramiko/paramiko/issues/515

I'm trying to create a script which reproduces the bug, but it might be a bit tough, because as I said it's not happening all the time.
msg391860 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-04-25 16:22
Python 2.7 is no longer maintained. If this is still a problem in python 3.8+, and you manage to produce a repro script, please open a new issue for it.
History
Date User Action Args
2022-04-11 14:58:15adminsetgithub: 68214
2021-04-25 16:22:07iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg391860

resolution: third party
stage: resolved
2015-04-24 09:10:16appidmansetmessages: + msg241929
2015-04-22 15:08:26r.david.murraysetnosy: + r.david.murray
messages: + msg241809
2015-04-22 14:17:44appidmancreate