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

Fix error checking to avoid calling NtQueryObject on bad objects #519

Merged
merged 2 commits into from
Jul 15, 2014
Merged

Fix error checking to avoid calling NtQueryObject on bad objects #519

merged 2 commits into from
Jul 15, 2014

Conversation

mrjefftang
Copy link
Collaborator

While doing a code review of my previous changes I spotted an error in the condition checking.

GetLastError was never called before checking the error value.

I was able to successfully cause psutil 2.1.1 (PyPi) on Python 3.4.1 to hang by calling get_open_files(). After this patch, get_open_files() returns the correct results.

This should solve issue #340

giampaolo added a commit that referenced this pull request Jul 15, 2014
Fix error checking to avoid calling NtQueryObject on bad objects
@giampaolo giampaolo merged commit ab08172 into giampaolo:master Jul 15, 2014
@giampaolo
Copy link
Owner

It seems it worked. Thanks a lot Jeff. It appears you solved a very long standing issue.

@daveajones
Copy link

Yes thank you very much. I had abandoned a project because of this. Now I can go back to it. TY!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants