Skip to content

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

@LunNova

Description

@LunNova

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions