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 AIX bug for users with unlimited nofiles #41

Merged
merged 1 commit into from
Jul 2, 2017

Conversation

shmaix
Copy link

@shmaix shmaix commented Jun 28, 2017

When using pexpect on AIX, I encountered a bug where os.close() in openpty would hang when running under particular user accounts which had nofiles ulimit set to unlimited. After tracing, it appears that resource.RLIMIT_NOFILE for these users is 2^63-1, and os.closerange() was attempting to close a huge number of fds. Putting an arbitrary ceiling on max_fds resolves the issue. Feel free to increase/lower ceiling as desired, or put under an AIX OS check to further isolate.

@takluyver
Copy link
Member

I thought the idea of closerange() was that the OS could handle it efficiently even if the range was huge, because it doesn't need to try every possible number as an fd. I think this is reasonable, though.

@takluyver takluyver merged commit b9b03b7 into pexpect:master Jul 2, 2017
@shmaix
Copy link
Author

shmaix commented Jul 2, 2017

Agree, that was my understanding of closerange() as well. I think this is most likely a Python-AIX implementation issue, it wouldn't be the first I've come across, I'll be raising a support call to IBM to take a look as well. Thanks! :)

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.

3 participants