benfred / py-spy

Sampling profiler for Python programs
MIT License
12.89k stars 431 forks source link

Fix corruption when running cargo test on ARM64 #693

Closed jiangliu closed 1 month ago

jiangliu commented 1 month ago

Run cargo test on ARM64 will encounter following corruption, which is caused by unaligned memory access. So enable the test for x86_64 only.

thread 'coredump::test::test_coredump' panicked at src/coredump.rs:94:30: misaligned pointer dereference: address must be a multiple of 0x8 but is 0xffffa6ba0334 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread caused non-unwinding panic. aborting. error: test failed, to rerun pass --lib

Caused by: process didn't exit successfully: /dragonball/py-spy.git/target/debug/deps/py_spy-1a1c8047c3d9ee13 (signal: 6, SIGABRT: process abort signal)

benfred commented 1 month ago

Does https://github.com/benfred/py-spy/pull/657 fix the issue for you?

jiangliu commented 1 month ago

Does #657 fix the issue for you?

Yeah, missed that PR. I have tried #657 and it does fix the invalid memory access issue. BTW, it would be great to generate multiple test coredump files for different archs in crate py-spy-test:)

jiangliu commented 1 month ago

Prefer #657 instead of this one.