-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
libstd: File::open
uses O_CLOEXEC
on platforms where it is unsupported
#69862
Comments
If I hook |
I want to submit a patch for this, but I'm unsure about how to go about solving this issue. The first option I can think of is to explicitly check the kernel version by calling The second option is something like: "check if A third (probably undesirable) option is to just remove Any thoughts, suggestions, comments? |
That kernel would be as RHEL 5.0 originally shipped, without any updates at all! See rhbz313681, "O_ATOMICLOOKUP vs O_CLOEXEC(mainstream kernels) incompatibility". Your strace log even shows the error return -530, corresponding to You should also know that there's pressure to raise the minimum kernel support -- see #62516. As a Red Hat engineer, I've pushed back on that so far, but only because I still need RHEL5 kernel support to build for RHEL6 myself. I will likely yield when RHEL6 is retired, November 30, 2020, which is also when RHEL5 leaves extended life-cycle support. https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates |
We are indeed in very unsupported territory. Currently my organization is using RHEL5 with an expired support contract. I will have to look into upgrading our kernel. I hope we will be able to do that without a support contract, though I am not personally familiar with the details. (ETA: a brief perusal of the relevant Red Hat literature suggests that this is not allowed by the RHEL5 licensing agreement. I will have to contact our sysadmin to see if this is still the case, or if the situation can be rectified.) That being said, it appears that this is not a Rust issue. As such, I think I can safely close all of the above tickets. |
I was originally trying to install the latest Rust stable on
Linux 2.6.18-8.el5 i686
(CC rustup#2254), and failing whenRUSTUP_HOME
orCARGO_HOME
were set to my NFS mount (which uses 64 bit inodes).This led me to (erroneously) file a bug with
libc
(CC libc#1679), thinking that it was an issue with 64 bit inode support whereinlibc
did not call the 64-bit version ofstat
and friends. This was not the case: runningstrace -f rustup update
led me to find this curious sequence of syscalls in the trace output:strace.log
As you can see: we are passing
0x80000 = O_CLOEXEC
to theopen
call, which leads to an error code when the file in question is on the NFS mount (or perhaps it's a symlink issue --/home/LOCAL/tla/.local/
is actually a symlink to a directory on the NFS mount). Reproducing the above sequence of syscalls with a small test program written in C shows that thisopen
call only fails when the erroneousO_CLOEXEC
argument is passed.It is my suspicion that this line is the culprit. Comments there suggest that passing this flag on systems where it is unsupported (such as mine) will have no effect. I don't know enough about how the
open
syscall works to confirm, but it appears that is not the case with my configuration.The text was updated successfully, but these errors were encountered: