[issue11223] interruption of locks by signals not guaranteed when the semaphore implementation is not used

STINNER Victor report at bugs.python.org
Thu Feb 17 11:55:14 CET 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

> Here is what faulthandler reports when I trigger it as Python
> is locked in test_socket:
> ...
>  File ".../Lib/test/fork_wait.py", line 30 in f

faulthandler doesn't print the source code line (yet?). Here is the code:

class ForkWait(unittest.TestCase):
    ...
    def f(self, id):
        while not self.stop:
            self.alive[id] = os.getpid()
            try:
                time.sleep(SHORTSLEEP) <~~~ here
            except IOError:
                pass

ForkWait.f() is used by ForkWait.test_wait() which creates 4 threads. You may use all_threads=True option of faulthandler to get the backtrace of all threads.

Because ForkWait.test_wait() uses fork, you may also need to dump the backtrace of two processes.

Debug threads+multiple processes is something horrible :-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11223>
_______________________________________


More information about the Python-bugs-list mailing list