Skip to content

Commit

Permalink
Try strace instead of gdb to see what wedged child is doing.
Browse files Browse the repository at this point in the history
  • Loading branch information
shibturn committed Oct 17, 2013
1 parent a3cf1aa commit e4508ee
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Lib/test/_test_multiprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@ def test_process(self):

@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':
Expand Down Expand Up @@ -313,12 +316,11 @@ def handler(*args):
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)
Expand Down

0 comments on commit e4508ee

Please sign in to comment.