remoteprocess icon indicating copy to clipboard operation
remoteprocess copied to clipboard

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

Open LunNova opened this issue 3 years ago • 0 comments

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.

LunNova avatar Dec 05 '22 00:12 LunNova