python-ptrace
python-ptrace copied to clipboard
process.detach Leaves Files Open
When process.detach is called the file handle to /proc/pid/mem is left open.
Can you come up with a fix? This project is basically unmaintained, you have to fix the bugs that you find :-)
It seems I am unable to reproduce the issue.
The steps taken were:
- Adding a 10m sleep at the end of
strace.py; - Launching an instance of
strace.py; - Listing the opened files of the sleeping process.
~> lsof -p 8238 | grep /proc returns no matches.
The confusion might come from the fact that the /proc/<pid>/mem file is closed in a detach wrapper, _notRunning in ptrace/debugger/subprocess.py:302.