Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash On M1 Mac #187

Open
0xtyls opened this issue Dec 15, 2022 · 6 comments
Open

Crash On M1 Mac #187

0xtyls opened this issue Dec 15, 2022 · 6 comments

Comments

@0xtyls
Copy link

0xtyls commented Dec 15, 2022

I integrate pprof-rs into my own application and provide a http server like tikv did. When I request on http://ip:port/debug/pprof/profile?seconds=10, the application crashes. Here is the crash report from Mac Console:

Code Type: ARM-64 (Native)
OS Version: macOS 12.3.1 (21E258)
Crashed Thread: 1 tokio-runtime-worker

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001abf9774c
Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process: exc handler [63517]

Thread 0:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x1a144c290 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x1a148683c _pthread_cond_wait + 1236
2 xxx 0x103001588 0x102eb0000 + 1381768
3 xxx 0x10336a518 0x102eb0000 + 4957464
4 xxx 0x103155d38 0x102eb0000 + 2776376
5 xxx 0x1031105ac 0x102eb0000 + 2491820
6 xxx 0x103154954 0x102eb0000 + 2771284
7 dyld 0x1039ed088 start + 516

Thread 1 Crashed:: tokio-runtime-worker
0 libunwind.dylib 0x1abf9774c libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::step() + 636
1 libunwind.dylib 0x1abf97500 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_arm64>::step() + 48
2 libunwind.dylib 0x1abf9a138 _Unwind_Backtrace + 352
3 xxx 0x103004028 0x102eb0000 + 1392680
4 libsystem_platform.dylib 0x1a149d4c4 _sigtramp + 56
5 ??? 0xffff8001a1294c08 ???
......

@YangKeao
Copy link
Member

See #131 (comment). I think they are the same problem 🤔

@0xtyls
Copy link
Author

0xtyls commented Dec 16, 2022

Thanks for your reply. By adding "frame-pointer" in the feature list, the profile is generated. But the graph does not show anything useful. See the graph below.

image

@Rustin170506
Copy link
Member

Thanks for your reply. By adding "frame-pointer" in the feature list, the profile is generated. But the graph does not show anything useful. See the graph below.

It works well on my M1 Mac. Could you please provide a minimal project that I can help test and run it?

@szandara
Copy link

szandara commented Sep 6, 2023

I have a related issue

'misaligned pointer dereference: address must be a multiple of 0x10 but is 0x16b1ff168', /Users/zandaras/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pprof-0.12.1/src/profiler.rs:330:36

Any idea? it works on Intel

@YangKeao
Copy link
Member

YangKeao commented Sep 6, 2023

@szandara

For this problem: "misaligned pointer dereference", I think it has been fixed in 0.12.1 (#217). Please check whether you have upgraded it to the latest version 🍻

@andrehp
Copy link

andrehp commented Sep 13, 2023

@YangKeao I had the same issue as @szandara , running version 0.12.1:

thread 'main' panicked at 'misaligned pointer dereference: address must be a multiple of 0x10 but is 0x16ef53a58', /Users/andrehahn/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pprof-0.12.1/src/profiler.rs:330:36

I'm trying to find a small sample to reproduce the issue, but a new project with the bare minimum doesn't have this issue. When testing with the codebase that throws this error, it happens even in the main function before anything else is done, but doesn't happen when I remove some parts, I'm still trying to find the culprit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants