-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
test_os: test_get_set_inheritable_o_path() failed on AMD64 FreeBSD Shared 3.x #89012
Comments
Since build 655 (commit 6871fd0), test_os failed on AMD64 FreeBSD Shared 3.x: ====================================================================== Traceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd-564d/build/Lib/test/test_os.py", line 3898, in test_get_set_inheritable_o_path
os.set_inheritable(fd, True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 9] Bad file descriptor |
test_get_set_inheritable_o_path() also fails on:
It smells more like a FreeBSD system update rather than a Python regression. |
On my FreeBSD 13 VM, the test is skipped: vstinner@freebsd$ ./python -m test -v test_os -m test_get_set_inheritable_o_path It seems like O_PATH was introduced in FreeBSD 14 CURRENT, but the test fails. Code of the test:
os.set_inheritable(fd, True) # <==== OSError: [Errno 9] Bad file descriptor
self.assertEqual(os.get_inheritable(fd), True)
os.set_inheritable(fd, False)
self.assertEqual(os.get_inheritable(fd), False) os.set_inheritable() calls _Py_set_inheritable() whichs has multiple implementations:
Linux has a special code path: #ifdef __linux__
if (errno == EBADF) {
// On Linux, ioctl(FIOCLEX) will fail with EBADF for O_PATH file descriptors
// Fall through to the fcntl() path
}
else
#endif Maybe we should just enable now this code path on FreeBSD as well. == test.pythoninto of the last successful build 654 == datetime.datetime.now: 2021-08-01 01:15:06.918625 os.uname: posix.uname_result(sysname='FreeBSD', nodename='140-CURRENT-amd64-564d', release='14.0-CURRENT', version='FreeBSD 14.0-CURRENT #14 main-n245176-8742817ba62: Tue Mar 2 03:48:10 UTC 2021 root@140-CURRENT-amd64:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', machine='amd64') == test.pythoninto of the failed build 655 == datetime.datetime.now: 2021-08-04 09:56:34.287999 os.uname: posix.uname_result(sysname='FreeBSD', nodename='140-CURRENT-amd64-564d', release='14.0-CURRENT', version='FreeBSD 14.0-CURRENT #0 main-n248401-de0c7fbe280: Mon Aug 2 02:42:31 UTC 2021 root@140-CURRENT-amd64-564d:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG', machine='amd64') |
There was a recent worker update to latest CURRENT (14). I'll try to identify recent changes or changesets that may have affected behaviour and reference them here |
O_PATH support was added in FreeBSD CURRENT April 15: https://reviews.freebsd.org/D29323?id=86257 @victor If the failure in this tests suggests either a bug in our implementation, or an incompatibility, please let me know/clarify so I can get our implementation polished |
Reference for Linux behaviour: filedesc: don't use ioctl(FIOCLEX) on Linux bpo-62425 Looks like we match the behaviour intentionally (or otherwise). |
AMD64 FreeBSD Shared 3.x is back to green: test_os.test_get_set_inheritable_o_path() now pass on FreeBSD CURRENT ;-) My fix works as expected. I simply used the same fix than for Linux. |
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: