mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Try strace instead of gdb to see what wedged child is doing.
This commit is contained in:
parent
a3cf1aa864
commit
e4508eebb4
1 changed files with 6 additions and 4 deletions
|
@ -273,7 +273,10 @@ class _TestProcess(BaseTestCase):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def _test_terminate(cls):
|
def _test_terminate(cls):
|
||||||
|
print('signal.getsignal(SIGTERM) =', signal.getsignal(signal.SIGTERM))
|
||||||
|
print('starting sleep')
|
||||||
time.sleep(100)
|
time.sleep(100)
|
||||||
|
print('finished sleep')
|
||||||
|
|
||||||
def test_terminate(self):
|
def test_terminate(self):
|
||||||
if self.TYPE == 'threads':
|
if self.TYPE == 'threads':
|
||||||
|
@ -313,12 +316,11 @@ class _TestProcess(BaseTestCase):
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
print('os.waitpid() =', os.waitpid(p.pid, os.WNOHANG))
|
print('os.waitpid() =', os.waitpid(p.pid, os.WNOHANG))
|
||||||
import subprocess
|
import subprocess
|
||||||
p = subprocess.Popen(['gdb', sys.executable, str(p.pid)],
|
|
||||||
stdin=subprocess.PIPE)
|
|
||||||
try:
|
try:
|
||||||
p.communicate(b'bt 50', timeout=10)
|
subprocess.check_call(['strace', '-p', str(p.pid)],
|
||||||
|
timeout=10)
|
||||||
except subprocess.TimeoutExpired:
|
except subprocess.TimeoutExpired:
|
||||||
p.kill()
|
pass
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
signal.signal(signal.SIGALRM, old_handler)
|
signal.signal(signal.SIGALRM, old_handler)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue