Building fails with "./configure: line 5177: 5: Bad file descriptor" on almalinux 9.3
Too many issues will kill our team's development velocity, drastically. Make sure you have checked all steps below.
Prerequisite
- [x] Make sure your problem is not listed in the common build problems.
- [x ] Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
- [x] Make sure you are not asking us to help solving your specific issue.
- GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
- [x] Make sure your problem is not derived from packaging (e.g. Homebrew).
- Please refer to the package documentation for the installation issues, etc.
- [x] Make sure your problem is not derived from plugins.
- This repository is maintaining
pyenvand the defaultpython-buildplugin only. Please refrain from reporting issues of other plugins here.
- This repository is maintaining
Description
- [x] Platform information (e.g. Ubuntu Linux 16.04): AlmaLinux 9.3
- [x] OS architecture (e.g. amd64): amd64
- [x] pyenv version: pyenv 2.3.35
- [x] Python version: Trying to install 3.12.1, but others fail as well e.g. 3.9.6
- [x] C Compiler information (e.g. gcc 7.3): GCC 11.4.1
- [x] Please attach the debug trace of the failing command as a gist:
- Run
env PYENV_DEBUG=1 <faulty command> 2>&1 | tee trace.logand attachtrace.log. E.g. if you have a problem with installing Python, runenv PYENV_DEBUG=1 pyenv install -v <version> 2>&1 | tee trace.log(note the-voption topyenv install).
- Run
- [x] If you have a problem with installing Python, please also attach
config.logfrom the build directory- The build directory is reported after the "BUILD FAILED" message and is usually under
/tmp.
- The build directory is reported after the "BUILD FAILED" message and is usually under
We are having problems using pyenv on our AlmaLinux 9.3 PCs. Building of python fails (regardless of the python version we are trying to build) with the message:
./configure: line 5085: 5: Bad file descriptor checking whether the C compiler works... ./configure: line 5132: 5: Bad file descriptor no ./configure: line 5177: 5: Bad file descriptor
When executing the configure command from the config.log (./configure --prefix=/mnt/storage/home/schmeing/.pyenv/versions/3.12.1 --enable-shared --libdir=/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/lib) manually it works. The config.log and trace.log can be found here.
Any idea what is going wrong here? Thanks in advance.
Looks like you have compiler-affecting envvars set with shell special characters (like newlines) that mess up the command lines.
configure:5108: checking whether the C compiler works
configure:5130: gcc -I/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/include -L/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/lib -Wl,-rpath,/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/lib conftest.c -L/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/lib -Wl,-rpath,/mnt/storage/home/schmeing/.pyenv/versions/3.12.1/lib >&5
configure:5134: $? = 1
configure:5174: result: no
configure: failed program was:
configure:5179: error: in `/mnt/storage/home/schmeing/src/python-build.20240205143045.381288/Python-3.12.1':
configure:5181: error: C compiler cannot create executables
See `config.log' for more details
Hi,
I'm a co-worker with the same problem and I doubt it's an environmental variable. Since running the ./configure script with the same arguments from the same shell works fine it looks something is different in the invocation of the ./configure script, which makes our python build fail.
I'm concentrating on the "bad file descriptor" error and quickly made a patch which modifies the configure script to show it's file descriptors right at the beginning by adding ls -l /proc/$$/fd. If I run it through a shell directly it shows
lrwx------ 1 pytest test 64 6. Feb 08:20 0 -> /dev/pts/0
lrwx------ 1 pytest test 64 6. Feb 08:20 1 -> /dev/pts/0
lrwx------ 1 pytest test 64 6. Feb 08:20 2 -> /dev/pts/0
lr-x------ 1 pytest test 64 6. Feb 08:20 255 -> /tmp/python-build.20240206081830.419504/Python-3.10.13/configure
while running it through pyenv gives me
lr-x------ 1 pytest test 64 6. Feb 08:30 0 -> pipe:[1211642]
lrwx------ 1 pytest test 64 6. Feb 08:30 1 -> /tmp/python-build.20240206083036.421464.log
lrwx------ 1 pytest test 64 6. Feb 08:30 2 -> /tmp/python-build.20240206083036.421464.log
lr-x------ 1 pytest test 64 6. Feb 08:30 255 -> /tmp/python-build.20240206083036.421464/Python-3.10.13/configure
lrwx------ 1 pytest test 64 6. Feb 08:30 3 -> /dev/pts/0
lrwx------ 1 pytest test 64 6. Feb 08:30 4 -> /tmp/python-build.20240206083036.421464.log
Marius
I'm concentrating on the "bad file descriptor" error and quickly made a patch which modifies the configure script to show it's file descriptors
That should help!
Descriptor 5 is supposed to point to config.log. Something probably goes wrong while opening it.
Seeing descriptors before and after the code line on the link should help to understand what's happening. As should adding set -x to configure.
So far, this seems to be something unconnected to Pyenv's logic -- something like system permissions and/or resource limits.
I've got this problem on RHEL8.
- It works after downgrading samba to
4.17.5-3 - It also works on samba
4.18.6-3when restricting thepasswdentry in/etc/nsswitch.confto justfiles.
https://bugzilla.samba.org/show_bug.cgi?id=15464 looks terribly suspicious. Should be fixed in samba-4.18.7 and samba-4.19.1.
I've got this problem on RHEL9, but Im not really in a position to downgrade samba.
Is there another workaround?
I've got this problem on RHEL9, but Im not really in a position to downgrade samba.
Is there another workaround?
Build the codebase with the fix and UPgrade it?