py-spy icon indicating copy to clipboard operation
py-spy copied to clipboard

Integration test test_thread_reuse() fails on linux/x86-64 and macos

Open jiangliu opened this issue 1 year ago • 1 comments

With unwind enabled, test_thread_reuse() fails with message:

---- test_thread_reuse stdout ----
thread 'test_thread_reuse' panicked at src/python_spy.rs:451:25:
Native stack traces not supported on this platform
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_thread_reuse

The root cause is that _get_pthread_id() succeeds on my dev machine but fails on github testbed.

It also fails on macos with message:

---- test_thread_reuse stdout ----
thread 'test_thread_reuse' panicked at tests/integration_test.rs:42:65:
called `Result::unwrap()` on an `Err` value: Failed to open process - check if it is running.

Caused by:
    0: Operation timed out (os error 60)
    1: Operation timed out (os error 60)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    test_thread_reuse

jiangliu avatar Oct 15 '24 11:10 jiangliu

The root cause is that _get_pthread_id() succeeds on my dev machine but fails on github testbed.

Do you have a link to a failing run here? We are running this integration_test.rs as part of the linux CI here on every PR - and I haven't seen a failure yet https://github.com/benfred/py-spy/blob/3b6f7832c2f16e03c8218956d5c959979f3f7736/.github/workflows/build.yml#L56

On linux, this test will need the native unwind support to work reliably (so compiled w/ --features unwind now) - and maybe this needs added to the build.yml cargo test ... command line (?)

It also fails on macos with message:

On OSX - the 0: Operation timed out (os error 60) messages usually mean that we are running into SIP restrictions https://github.com/benfred/py-spy?tab=readme-ov-file#why-am-i-having-issues-profiling-usrbinpython-on-osx =(

benfred avatar Oct 16 '24 18:10 benfred