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
Shell completely broken on platforms without O_CLOEXEC
#8023
Comments
Yup, because most things have O_CLOEXEC and we have no CI on Solaris and barely any users. Sorry! Really, our preferred solution would be for every platform to just acquire O_CLOEXEC.
So you mean this should be if (fd >= 0 && set_cloexec(fd)) { ? I would appreciate it if you would open a PR with the patch, because otherwise we'll end up describing the code instead of just writing it, and since I have no platform without O_CLOEXEC to test on (and no SPARC machine at all), I can't be sure that I've interpreted what you wrote correctly. EDIT: I've now applied my best reading of what you wrote. In future, if you already know the solution, please open a PR. |
Ah, thanks so much for responding so quickly. Thankfully this wasn't too hard to pin down. 👍🏻 EDIT: i should say that that condition also works. Understandably this went under the radar on an obscure platform (: |
I should state for those reading along at home that O_CLOEXEC was apparently added in Solaris 11 in... 2011. Even if we added Solaris CI (and it would probably be Illumos rather than Oracle Solaris) we would never have added Solaris 10. |
Ah yes, Solaris 10 is definitely very very out of date. |
@zhiayang I would be interested to know if the test suite passes now that interactive mode is working. |
@zanchey Most of the tests pass, barring the something about piping universal variables with strategy 2, and some dropped history items. Anyway from just using the shell, nothing seems broken so far. |
Fish version:
3.2.2
, built from source. Platform: Solaris 10, SPARC (64-bit).After compiling fish on such a platform (where
O_CLOEXEC
doesn't exist), running it gives the following output:Clearly, everything is broken, backspacing doesn't work, etc. The files stated actually exist (of course -- the current directory must also exist). What got me investigating was the fact that we have
Error 0
, which means no error.After some printf debugging and digging around, the culprit is here, at
fds.cpp:254
:After looking at the return value of
set_cloexec
, it is very obvious that this code path has never been tested and run.set_cloexec()
returns non-zero on error... which causes this function to fail -- when it should have succeeded.The correct comparison should be
set_cloexec(fd) != 0
.The text was updated successfully, but these errors were encountered: