-
Notifications
You must be signed in to change notification settings - Fork 668
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
Add implementation of PTRACE_{GET,SET}REGSET
#2044
Conversation
1d8a381
to
3b23859
Compare
f975abd
to
c9c186e
Compare
3822e12
to
5418add
Compare
- nix: Add `nix::sys::ptrace::{get,set}regs` for newer platforms that does not support `PTRACE_{GET,SET}REGS` (nix-rust/nix#2044) - syscalls: Add riscv32 and riscv64 syscall support (jasonwhite/syscalls#37) - lurk: Add syscalls groups (taken from strace) and parameter lists for riscv64 (will upstream when nix's PR is merged)
- nix: Add `nix::sys::ptrace::{get,set}regs` for newer platforms that does not support `PTRACE_{GET,SET}REGS` (nix-rust/nix#2044) - syscalls: Add riscv32 and riscv64 syscall support (jasonwhite/syscalls#37) - lurk: Add syscalls groups (taken from strace) and parameter lists for riscv64 (will upstream when nix's PR is merged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a CHANGELOG
7d8fd65
to
6afb523
Compare
Changelog added.
Edit: Can't reproduce on |
214ffca
to
5b7a353
Compare
I've rebased this patch to master. Any updates? |
From my perspective, all the work is blocked by #2166 |
Any updates? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for the late review, I have left some comments:
And, we switched to a new changelog mode, please see this on how to add one:)
BTW, #1695 has a good test, can we port it to this PR? |
Ported. |
7c0d740
to
589d8e1
Compare
Cannot reproduce aarch64 test errors on real hardware (Radxa Rock 5B, RK3588, rustc 1.70.0, Linux 5.10.110-20-rockchip) |
I think I will set up a Linux VM on my m1 Mac to give it a test. BTW, we run Nix's tests with |
Sorry for the late reply, I tested it in a aarch64 Linux VM, and it also failed with [steve@fedora steve]$ uname -a
Linux fedora 6.7.11-orbstack-00143-ge6b82e26cd22 #1 SMP Sat Mar 30 12:20:36 UTC 2024 aarch64 GNU/Linux
[steve@fedora test]$ sudo --preserve-env=HOME $(which cargo) test --all-features sys::test_ptrace::test_ptrace_syscall
Finished test [unoptimized + debuginfo] target(s) in 0.01s
Running unittests src/lib.rs (/home/steve/Documents/workspace/nix/target/debug/deps/nix-4701d15085df23b3)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 19 filtered out; finished in 0.00s
Running test/test.rs (/home/steve/Documents/workspace/nix/target/debug/deps/test-637c83b07deea78d)
running 1 test
test sys::test_ptrace::test_ptrace_syscall ... FAILED
failures:
---- sys::test_ptrace::test_ptrace_syscall stdout ----
thread 'sys::test_ptrace::test_ptrace_syscall' panicked at test/sys/test_ptrace.rs:262:59:
called `Result::unwrap()` on an `Err` value: EIO
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
sys::test_ptrace::test_ptrace_syscall
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 347 filtered out; finished in 0.00s
error: test failed, to rerun pass `--test test` Is there anything I can do to help debug the issue? |
It turns out to be my bad. I ran tests on non-root and it just skipped it. After some research it seems aarch64 and riscv64 does not support PTRACE_PEEKUSER at all and will just fail with EIO. I'll make that part of the test x86-only. |
Also added `PTRACE_{GET,SET}REGS` for most platforms other than x86 using aforementioned implementation.
The CI is still failing due to an unused import, let me give it a fix:) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, for the PR and your patience:)
This is related to #1695, but have many issues solved here:
{get,set}regset
now allows specifying which set of registers to read/write, as defined inRegisterSet
. This should be the expected behavior.PTRACE_{GET,SET}REGS
for most platforms other than x86 using aforementioned implementation.