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)
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? |
|
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:) |
SteveLauC
left a comment
There was a problem hiding this comment.
Thanks, for the PR and your patience:)
This is related to #1695, but have many issues solved here:
{get,set}regsetnow allows specifying which set of registers to read/write, as defined inRegisterSet. This should be the expected behavior.PTRACE_{GET,SET}REGSfor most platforms other than x86 using aforementioned implementation.