-
Notifications
You must be signed in to change notification settings - Fork 654
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
Wrong ptrace::write
signature
#1011
Comments
Nix's current ptrace API reflects the underlying system API. But in this case, we probably could've made it better. At a glance, I don't see why the Linux |
It was written to match the ptrace interface available in linux and bsd since linux lets you write the |
Maybe I'm misunderstanding something, but after searching for siginfo in the linux man page it seems like you can only write it when Additionally, it seems to me that in an ideal world, |
Hello, I recently ran into this issue on linux. So, on linux, PTRACE_POKEDATA takes a While I think having a unified API as an option would be okay, I think having the option of platform-specific variants would be nice. If there were a linux version taking data: c_long and a freebsd version taking data: c_int, that would protect people from pointer coercion related bugs. Additionally, for platforms which don't require passing a true pointer, the variant should not be unsafe. |
Sorry for hearing that, this issue has been fixed in #2324 |
Looks like this issue has been fixed, so close it. |
The signature of
ptrace::write
is:Correct me if I'm wrong, but shouldn't data be a
*const c_void
since we know that writing won't mutate data?Happy to make a PR for it, but wanted to confirm my understanding.
The text was updated successfully, but these errors were encountered: