#724·py-spy

py-spy segfault with --subprocesses

Author: singharpit94Created Nov 5, 2024Updated Sep 8, 2026

Hi, I noticed that using py-spy with subprocesses ends up giving a segmentation fault error. Below is a minimal reproducer

from concurrent.futures import ProcessPoolExecutor

def lfilter(filt_b, filt_a, x_t, axis=-1):
    import scipy.signal
    y_t = scipy.signal.lfilter(filt_b, filt_a, x_t, axis=axis)
    return y_t

if __name__ == '__main__':
    for _ in range(100):
        with ProcessPoolExecutor(1) as executor:
            executor.submit(lfilter, [1.0], [1.0], [1.0]).result()

Used the below command to run py-spy

py-spy record -o <> --subprocesses -- <filepath>

Can you please suggest solution for the above issue.