benfred / py-spy

Sampling profiler for Python programs
MIT License
12.14k stars 400 forks source link

Failing to get stacktrace for native on Linux #617

Open fzakaria opened 9 months ago

fzakaria commented 9 months ago

Hi!

I am trying to use py-spy on my project sqlelf. It's failing to generate native stack traces through with the --native flag turned on.

I enabled logging and see the following (repeating):

[2023-10-01T20:07:50.036807699Z DEBUG remoteprocess::linux] attached to thread 86516
[2023-10-01T20:07:50.037880260Z DEBUG remoteprocess::linux] detached from thread 86516
[2023-10-01T20:07:50.037933250Z WARN  py_spy] Failed to get stack trace from 86516: Failed to merge native and python frames (Have 3 native and 8 python)
[2023-10-01T20:07:50.038235706Z DEBUG remoteprocess::linux] attached to thread 86516
[2023-10-01T20:07:50.039267936Z DEBUG remoteprocess::linux] detached from thread 86516
[2023-10-01T20:07:50.039317932Z WARN  py_spy] Failed to get stack trace from 86516: Failed to merge native and python frames (Have 4 native and 9 python)
[2023-10-01T20:07:50.040563003Z DEBUG remoteprocess::linux] attached to thread 86516
[2023-10-01T20:07:50.041708051Z DEBUG remoteprocess::linux] detached from thread 86516
[2023-10-01T20:07:50.041758075Z WARN  py_spy] Failed to get stack trace from 86516: Failed to merge native and python frames (Have 3 native and 8 python)

What can I do to debug this?

❯ py-spy --version
py-spy 0.3.14

❯ python --version
Python 3.11.5

❯ uname -r
6.4.4-3rodete1-amd64