python-ptrace icon indicating copy to clipboard operation
python-ptrace copied to clipboard

process.detach Leaves Files Open

Open kriscory opened this issue 6 years ago • 2 comments

When process.detach is called the file handle to /proc/pid/mem is left open.

kriscory avatar Apr 04 '19 14:04 kriscory

Can you come up with a fix? This project is basically unmaintained, you have to fix the bugs that you find :-)

vstinner avatar Apr 04 '19 15:04 vstinner

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.

spoutn1k avatar Aug 19 '20 17:08 spoutn1k