Hi there

I hope you don't mind me sharing my experience with testing the
austinp variant of Austin with Python >=2.7,<3.11.

The austinp variant is a variant of Austin
(https://github.com/P403n1x87/austin) for Linux that uses ptrace to
seize and interrupt/continue threads to capture native stack traces
using libunwind. During testing, I have discovered that there are good
chances of causing what looks like a deadlock in Python if the seizing
and interrupting of threads happen very early when spawning a Python
subprocess from austinp. This seems to coincide with the
initialisation of the interpreter when modules are being loaded. To
avoid interfering so destructively with Python, I have added a sleep
of about 0.5s on fork to prevent sampling during this initialisation
phase, which has helped significantly.

However, I think this poses one question: is this behaviour from
Python to be expected or is it perhaps an indication of a potential
bug? Whilst I find it conceivable that something like this could
happen, given the locking that happens around imports, is it
acceptable that the pausing and resuming of the execution of a thread
lead to a potential deadlock?

Cheers,
Gabriele
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EWE5IK53IAME7ODZOGCQGSSP4YBE37YX/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to