Try strace instead of gdb to see what wedged child is doing.

This commit is contained in:
Richard Oudkerk 2013-10-17 12:10:45 +01:00
parent a3cf1aa864
commit e4508eebb4
1 changed files with 6 additions and 4 deletions

View File

@ -273,7 +273,10 @@ class _TestProcess(BaseTestCase):
@classmethod
def _test_terminate(cls):
print('signal.getsignal(SIGTERM) =', signal.getsignal(signal.SIGTERM))
print('starting sleep')
time.sleep(100)
print('finished sleep')
def test_terminate(self):
if self.TYPE == 'threads':
@ -313,12 +316,11 @@ class _TestProcess(BaseTestCase):
except RuntimeError:
print('os.waitpid() =', os.waitpid(p.pid, os.WNOHANG))
import subprocess
p = subprocess.Popen(['gdb', sys.executable, str(p.pid)],
stdin=subprocess.PIPE)
try:
p.communicate(b'bt 50', timeout=10)
subprocess.check_call(['strace', '-p', str(p.pid)],
timeout=10)
except subprocess.TimeoutExpired:
p.kill()
pass
raise
finally:
signal.signal(signal.SIGALRM, old_handler)