Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiprocessing Deadlock with v0.4.0 #732

Open
mlucool opened this issue Dec 4, 2024 · 0 comments
Open

Multiprocessing Deadlock with v0.4.0 #732

mlucool opened this issue Dec 4, 2024 · 0 comments

Comments

@mlucool
Copy link

mlucool commented Dec 4, 2024

Hi,

The following causes py-spy to hang randomly, both with --subprocess and without. When we looked at the process, it seems like one thread is waiting to to recv from a channel.

In this reproducer, you'll see that one of the samples will cause it to hang forever.

$ cat py_spy_crash.py
#!/usr/bin/env python3
from concurrent.futures import ProcessPoolExecutor
from scipy.signal import lfilter
for ix in range(2):
    with ProcessPoolExecutor(1) as executor:
        executor.submit(lfilter, [1.0], [1.0], [1.0]).result()
    print(f"done with {ix=}", flush=True)
$ for i in `seq 100`; do time -p py-spy record -o /dev/null --subprocesses -- ./py_spy_crash.py; done

You can also run it without --subprocesses and see that this happens.

$ for i in `seq 100`; do time -p py-spy record -o /dev/null -- ./py_spy_crash.py; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant