> Do you know what is involved in the deadlock (as in, what the threads are 
> waiting on)?

I've found it hard to give an answer to this question. Because austinp
is already tracing the interpreter, I cannot use, e.g., gdb to dump a
backtrace. The event is also quite rare and it seems to happen before
austinp has the chance to capture any samples. With the new support
for 3.11 I might be able to see if I come across the same issue with
the latest beta. I was hoping that the description of the issue could
have rung a bell for anybody more familiar than me with all the
locking going on during imports. The logs from austinp seem to suggest
that the thread fails to resume after being interrupted, so something
for me to explore is whether attempting to resume the thread more
times before giving up is the actual solution in this case.

> How do you spawn a new process?

I should have clarified that this is just a plain fork/exec from C:
https://github.com/P403n1x87/austin/blob/e3d79ddc9f9737a791362e6962b5cac25a4e3dc2/src/py_proc.c#L972-L1010

Cheers,
Gabriele

On Mon, 6 Jun 2022 at 16:30, Victor Stinner <vstin...@python.org> wrote:
>
> On Mon, Jun 6, 2022 at 4:35 PM Gabriele <phoenix1...@gmail.com> wrote:
> > 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.
>
> Do you have a backtrace of the Python main thread when the hang
> happens? How do you spawn a new process? With the Python subprocess
> module?
>
> Victor
> --
> Night gathers, and now my watch begins. It shall not end until my death.



-- 
"Egli è scritto in lingua matematica, e i caratteri son triangoli,
cerchi, ed altre figure
geometriche, senza i quali mezzi è impossibile a intenderne umanamente parola;
senza questi è un aggirarsi vanamente per un oscuro laberinto."

-- G. Galilei, Il saggiatore.
_______________________________________________
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/DHRBK2WNXQJNKKQDHTGNSKRQ32MO365H/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to