pprof-rs icon indicating copy to clipboard operation
pprof-rs copied to clipboard

Getting a seg fault with no error or line number

Open JohnAllen opened this issue 1 year ago • 2 comments

Getting a seg fault with no error printed. I'm not using any other profilers. Tried a bunch of things (turning off flame graph and not using parallel iterations and stuff) but to no avail. Using 0.11.1. Tried --release and without it. Sorry I can't help more.

The only thing i do get is a number before segmentation fault which changes, e.g. 2953 segmentation fault and 3108 segmentation fault. Not sure what that is as I'm still new to Rust.

JohnAllen avatar Mar 06 '23 18:03 JohnAllen

Could you please provide more information about your environment? Or could provide a minimal project which can reproduce it.

Rustin170506 avatar May 07 '23 10:05 Rustin170506

@hi-rustin . I think I got the same problem when I was benchmarking my code. I make a minimal piece of code to reproduce the issue here. Copy this bench file and run it can cause the issue.

  • cargo bench --bench bench-fault works well
  • give --profile-time will cause issues like: cargo bench --bench bench-fault -- --profile-time=1

I think it is because of format! macro.

  • I don't know why it gives me signal: 10, SIGBUS: access to undefined memory
  • I am not sure if the format! is the only reason my code have this issue.

My env:

  • macOS 13.3.1
  • M2 CPU
  • rustc 1.71.0-nightly (4a59ba4d5 2023-05-12)

ccqpein avatar May 14 '23 15:05 ccqpein