linux: wait for process before detach, and send SIGCONT #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "XeroOl/mem_edit:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every once in a while, the ptrace call would fail because the process
has not yet stopped from SIGSTOP. From this stackoverflow answer, it
seems that you can use waitpid to wait until the process is actually
stopped. In python, this is exposed as os.waitpid.
https://stackoverflow.com/questions/20510300/ptrace-detach-fails-after-ptrace-cont-with-errno-esrch#20525326
Additionally, the process was left frozen. Sending a SIGCONT tells
the process to continue, undoing the effect of SIGSTOP. This means
that the process isn't frozen when detached.
Thank you for the fix and explanation!