Add PTRACE_INTERRUPT call as ptrace::interrupt(pid) #1422
Add PTRACE_INTERRUPT call as ptrace::interrupt(pid) #1422bors[bot] merged 1 commit intonix-rust:masterfrom blaind:master
ptrace::interrupt(pid) #1422Conversation
| Parent { child } => { | ||
| ptrace::seize(child, ptrace::Options::PTRACE_O_TRACESYSGOOD).unwrap(); | ||
| ptrace::interrupt(child).unwrap(); | ||
| assert_eq!(waitpid(child, None), Ok(WaitStatus::PtraceEvent(child, Signal::SIGTRAP, 128))); |
There was a problem hiding this comment.
This I verified, interrupt will fire the PtraceEvent. Not sure about the third parameter 128, is it same over all systems?
There was a problem hiding this comment.
Good question. Where did you copy the 128 parameter from?
There was a problem hiding this comment.
I took it from the waitpid(...) return state. Seems that internally it converts status through
#[cfg(any(target_os = "android", target_os = "linux"))]
fn stop_additional(status: i32) -> c_int {
(status >> 16) as c_int
}
|
@blaind could you please fix the compile failures? |
I had a look, the builds are failing now because of missing variables on various platforms. On android, I guess one way to fix is to go back with feature gate ( |
|
It's failing on non-Linux platforms because stuff like PTRACE_SEIZE is Linux-specific. That's why they were feature gated to begin with. I only asked about removing the mips restriction, not the OS restriction. |
I mistakenly took architecture to mean OS as well. Anyway, just pushed a new commit that might fix it. Testing is semiwhat slow, as I can not test locally. |
|
Note, this is a duplicate of #1279 (which omits tests). Whichever PR gets merged, the other should be closed. |
asomers
left a comment
There was a problem hiding this comment.
Could you please rebase onto master to fix the conflicts?
Done |
asomers
left a comment
There was a problem hiding this comment.
Ok, everything looks good now. Would you mind squashing your commits?
| - Added `sendfile64` (#[1439](https://github.com/nix-rust/nix/pull/1439)) | ||
| - Added `MS_LAZYTIME` to `MsFlags` | ||
| (#[1437](https://github.com/nix-rust/nix/pull/1437)) | ||
| - Added `ptrace::interrupt` method for platforms that support `PTRACE_INTERRUPT` |
There was a problem hiding this comment.
Shoot. I just noticed that your CHANGELOG entry got moved into the wrong part of the file when you rebased. You'll have to move it up to the top.
There was a problem hiding this comment.
Whoops, I forgot to stop bors when I found the CHANGELOG. problem. Don't worry; I'll take care of it.
There was a problem hiding this comment.
Oops, sorry about that. Did not notice when rebasing with master. Thanks for fixing!
I've based the test on
fn test_ptrace_cont. Removed some parts, but not 100% sure what's the proper way of testing in nix context.From ptrace-man page: