]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Try strace instead of gdb to see what wedged child is doing.
authorRichard Oudkerk <shibturn@gmail.com>
Thu, 17 Oct 2013 11:10:45 +0000 (12:10 +0100)
committerRichard Oudkerk <shibturn@gmail.com>
Thu, 17 Oct 2013 11:10:45 +0000 (12:10 +0100)
Lib/test/_test_multiprocessing.py

index ac1b2a79b734810386e13893df8a3bd65974eb2b..d2b9403680cc5d9d2d1bcc1500c6bfef9c3a0806 100644 (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)