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
set_inheritable(): ioctl(FIOCLEX) is available but fails with ENOTTY on Illumos #66454
Comments
I've found on illumos-based OS that under some conditions python is unable to open any files because set_inheritable() fails. This happens even when building python when it cannot find (open) _sysconfigdata.py. The problem is that set_inheritable() first checks for FIOCLEX/FIONCLEX ioctls and tries to use them if such macros are defined. These macros can be defined at illumos, but kernel does not support them (inappropriate ioctl). Since other pieces of python already use FD_CLOEXEC unconditionally, including get_inheritable() I patched set_inheritable() to use FD_CLOEXEC. See attached patch. |
The patch doesn't look correct. Ioctl() reduces the overhead in term of What is the errno value on failure? We should remember that ioctl() doesn't See the PEP-446. |
errno is 25 (#define ENOTTY 25 /* Inappropriate ioctl for device */) It does not make sense to me to call unworkable ioctl() each time before other methods :-) I would consider adding a configure check for working ioctl() (but it won't work for cross compilation). |
I propose to only call ioctl() once, and then remember (in a static I can work on a patch. |
@igor: Here is a patch. Can you please apply it and run "./python -m test -v test_os" on your OS? I tried it manually on Linux by forcing the errno to ENOTTY. |
Ping Igor. |
Yes, Victor. Your patch works. All os tests are passed :-) |
New changeset 27cef7476f2b by Victor Stinner in branch '3.4': New changeset 4a51c45f405b by Victor Stinner in branch 'default': |
Thanks for the tests. I pushed my fix to Python 3.4 & 3.5. |
"the the" |
New changeset 9d5386a22e68 by Victor Stinner in branch 'default': |
Oh, thanks for the report. It's now fixed. It would be better to have the Misc/NEWS entry in the patch directly :-( |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: