rbspy: Error "No stack counts found" trying to use rbspy at all on macOS Catalina

Since this seems different enough from this issue: https://github.com/rbspy/rbspy/issues/226 I opted to file a new one. Apologies if that was inappropriate.

Environment:

  • macOS Catalina (10.15.4)
  • rbenv 1.1.2
  • ruby 2.7.1, 2.6.6, 2.5.7
  • bash, zsh
  • rbspy 0.3.8 via brew, master via local compilation (a5a2d609224e890e26454b15c065fbc1cf0f4d3f)

Attempting to use rbspy at all from the command line, be it for Rails, a script on disk, or ruby -e, all produce the same error:

❯ RUST_BACKTRACE=1 sudo --preserve-env ~/Code/rbspy/target/release/rbspy record -- ruby -e "puts ('hello world')"
Dropping permissions: running Ruby command as user justin
Press Ctrl+C to stop
Wrote raw data to /Users/justin/.cache/rbspy/records/rbspy-2020-05-04-vXYSiGpWwZ.raw.gz
Writing formatted output to /Users/justin/.cache/rbspy/records/rbspy-2020-05-04-4UBOfOEv2Z.flamegraph.svg
[2020-05-04T15:02:02Z ERROR inferno::flamegraph] No stack counts found
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: InvalidData, error: "No stack counts found" })', src/libcore/result.rs:999:5
stack backtrace:
   0: std::panicking::default_hook::{{closure}}
   1: std::panicking::default_hook
   2: std::panicking::rust_panic_with_hook
   3: std::panicking::continue_panic_fmt
   4: rust_begin_unwind
   5: core::panicking::panic_fmt
   6: core::result::unwrap_failed
   7: rbspy::ui::flamegraph::Stats::write
   8: rbspy::do_main
   9: rbspy::main
  10: std::rt::lang_start::{{closure}}
  11: std::panicking::try::do_call
  12: __rust_maybe_catch_panic
  13: std::rt::lang_start_internal
  14: main
❯ hello world

Not that hello world appears in STDOUT some moments later in what appears to be a separate thread.

And here it is using the debug binary and backtrace env var:
RUST_BACKTRACE=1 sudo --preserve-env ~/Code/rbspy/target/debug/rbspy record -- ruby -e "puts ('hello world')"
Dropping permissions: running Ruby command as user justin
Press Ctrl+C to stop
Wrote raw data to /Users/justin/.cache/rbspy/records/rbspy-2020-05-04-HeCenPRs1Z.raw.gz
Writing formatted output to /Users/justin/.cache/rbspy/records/rbspy-2020-05-04-QV3dZ1egzg.flamegraph.svg
[2020-05-04T15:02:43Z ERROR inferno::flamegraph] No stack counts found
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: InvalidData, error: "No stack counts found" })', src/libcore/result.rs:999:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /Users/vsts/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:47
   3: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:36
   4: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:200
   5: std::panicking::default_hook
             at src/libstd/panicking.rs:214
   6: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:477
   7: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:384
   8: rust_begin_unwind
             at src/libstd/panicking.rs:311
   9: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  10: core::result::unwrap_failed
             at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libcore/macros.rs:18
  11: core::result::Result<T,E>::unwrap
             at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libcore/result.rs:800
  12: rbspy::ui::flamegraph::Stats::write
             at src/ui/flamegraph.rs:38
  13: <rbspy::ui::output::Flamegraph as rbspy::ui::output::Outputter>::complete
             at src/ui/output.rs:25
  14: rbspy::parallel_record
             at src/main.rs:546
  15: rbspy::do_main
             at src/main.rs:191
  16: rbspy::main
             at src/main.rs:281
  17: std::rt::lang_start::{{closure}}
             at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libstd/rt.rs:64
  18: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  19: std::panicking::try::do_call
             at src/libstd/panicking.rs:296
  20: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:82
  21: std::panicking::try
             at src/libstd/panicking.rs:275
  22: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  23: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  24: std::rt::lang_start
             at /rustc/eae3437dfe991621e8afdc82734f4a172d7ddf9b/src/libstd/rt.rs:64
  25: rbspy::OutputFormat::variants

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 10
  • Comments: 33 (2 by maintainers)

Most upvoted comments

@f3ndot In this case, we do know what the unknown c function is because of your code, but it seems like anything that hits native extensions shows up that way. Having rbspy indicate it was the sleep function would be helpful. I may just file another issue about that.