Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite get_open_files #596

Closed
wants to merge 6 commits into from
Closed

Conversation

mrjefftang
Copy link
Collaborator

I rewrote get_open_files to clean up a lot of the code and to address the error cases where handles or memory aren't closed/free'd.

This will address #542 since the access mask check is removed.

Hopefully this will address the newest issue in #340 but I don't have a Windows machine with bluetooth to test that. Maybe @jimbo1969 can retest this.

@mrjefftang mrjefftang closed this Feb 24, 2015
@mrjefftang mrjefftang reopened this Feb 24, 2015
@mrjefftang
Copy link
Collaborator Author

I closed/re-opened the PR to trigger a new build and it looks like that test case that initially failed is nondeterministic.

@giampaolo
Copy link
Owner

Have you tested this on both Python 2 and 3? Do "make.bat test" and "make.bat test-memleaks" pass?

@mrjefftang
Copy link
Collaborator Author

Note that I still think the way forward is to go the Sysinternals Handles route and spawn a thread that calls NtQueryObject and waits a for a timeout and kills it off. Looks like we can avoid the associated memory leaks by converting the thread to a fiber.

Fixed an issue that looks like it was in the master branch relating to Process.ppid() on Windows.

Test failure on Python 3.4 is related to memory leak for net_if_addrs:

======================================================================
FAIL: test_net_if_addrs (__main__.TestModuleFunctionsLeaks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\test_memory_leaks.py", line 413, in test_net_if_addrs
    self.execute('net_if_addrs')
  File "test\test_memory_leaks.py", line 86, in execute
    % (rss2, rss3, difference))
AssertionError: rss2=17768448, rss3=18120704, difference=352256
----------------------------------------------------------------------

Python 2.7:

======================================================================
FAIL: test_net_if_stats (__main__.TestModuleFunctionsLeaks)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test\test_memory_leaks.py", line 417, in test_net_if_stats
    self.execute('net_if_stats')
  File "test\test_memory_leaks.py", line 86, in execute
    % (rss2, rss3, difference))
AssertionError: rss2=12668928, rss3=13201408, difference=532480

----------------------------------------------------------------------

@mrjefftang mrjefftang closed this Apr 16, 2015
@mrjefftang mrjefftang deleted the get_open_files branch August 3, 2015 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants