Skip to content
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

linux/windows: Process.lock() behavior diverges when using ManuallyDrop #61

Open
LunNova opened this issue Dec 5, 2022 · 0 comments
Open

Comments

@LunNova
Copy link
Contributor

LunNova commented Dec 5, 2022

This may not be a bug and just need documented:

On Windows using ManuallyDrop with the result of Process.lock will leave the process suspended forever.
On Linux the process will resume after the rust process exits.

This is due to SuspendThread and ptrace attach having different behavior. With ptrace, the process is always resumed once the debugging process exits.

One possible workaround is to directly send SIGSTOP. Whether this library should do this is unclear.

If there was a separate API Process.suspend and Process.resume which deliberately allowed leaving the process suspended then sending SIGSTOP on Linux would be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant