grafana / pyroscope-rs

Pyroscope Profiler for Rust. Profile your Rust applications.
Apache License 2.0
132 stars 22 forks source link

version 0.5.7 appears to break for crates in workspaces on linux Ubuntu 20.04 #133

Open rajsahae opened 10 months ago

rajsahae commented 10 months ago

Describe the bug you encountered:

We updated pyroscope to 0.5.7 (from 0.5.5) which pulls in pprofrs 0.2.7 (from 0.2.5) and noticed our crates stopped reporting frame data. C++ binding crates still reported.

After some investagation, we realized that the basic example compiled inside our crate workspace would fail in the same way, but outside the workspace, it was fine.

We then ran an experiment between pyroscope 0.5.5 and 0.5.7 (also with rust versions 1.65 and 1.71) with and without workspaces. It seems clear that workspaces are the problem, and it used to be fine on 0.5.5.

See the table below of permutations tested

rust version: 1.65, 1.71
workspace: true, false
pyroscope: 0.5.5 (pyroscope_pprofrs 0.2.5, pprof 0.11.7), 0.5.7 (pyroscope_pprofrs 0.2.7, pprof 0.12.1)

scenarios

RV          WS              PS          Result
============================================================================================
1.65            false                   0.5.5           OK
1.65            false                   0.5.7           OK
1.71            false                   0.5.5           OK
1.71            false                   0.5.7           OK

1.65            true                0.5.5           OK
1.65            true                0.5.7           Fail
1.71            true                0.5.5           OK
1.71            true                0.5.7           Fail

What did you expect to happen instead?

We expect that the basic example compiled inside a crate workspace should still show frame data in pyroscope.

How did you install pyroscope-rs?

Added as a crate dependency and the binary is built via cargo build.

pyroscope-rs version and environment

Ubuntu 20.04 rust versions 1.65 and 1.71 gcc/g++ 10.3.0

I have attached a tarball of the experiment files used, in case that helps.

pyrotest.zip