-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Compilation crashes with undefined symbol: _ZSt28__throw_bad_array_new_lengthv
(Fedora 34, gcc 11)
#294
Comments
Hi, what compiler (version) do you have? |
|
Same happens with |
You certainly should be able to get things working if you compile httpstan yourself (rather than using the PyPI wheel). It's really unfortunate things do not work cleanly on the most recent version of Fedora. Makes me worried that gcc 11 might have introduced some problems that will eventually affect Debian-based linuxes. |
undefined symbol: _ZSt28__throw_bad_array_new_lengthv
undefined symbol: _ZSt28__throw_bad_array_new_lengthv
(Fedora 34, gcc 11)
Thanks for a quick reply! I'll try compiling myself next... |
@solbes Looks like pystan works when run on the fedora 34 docker image (using GitHub Actions' runner). Have you installed a new gcc or are you using something other than x86-64? |
Interesting... I haven't done any separate gcc installations, I'm using version 11.1.1. I have two machines, one AMD and one Intel, both have the same issue. I switched to |
Thanks for the update. I'll spin up a fedora 34 VM and see if I can find out what is wrong. |
I'm unable to reproduce this.
I also re-ran things after doing a The error you're getting looks like a libstdc++ problem. I did a bit of searching and found this, JuliaLang/julia#40703 . Perhaps there's some connection? |
Thanks for the effort! Really appreciated. I’ll try to dig deeper at some point... |
I don't use this, so this is a drive-by comment while I'm looking for the problem. I see you used Python 3.7, which is not the default on Fedora 34, but your version of gcc is from Fedora. Are you using a conda environment? The |
I tried different python versions, that 3.7 was the last one I tested. I am using conda, that’s a good guess! |
@QuLogic indeed outside conda things work! Thanks a lot. FYI @riddell-stan |
I think this is the GCC commit that is causing this problem: gcc-mirror/gcc@f92a504 And basically, conda has libstdc++.so.6.0.28 but fedora 34 has libstdc++.so.6.0.29:
A temporary workaround until conda gets an updated libstdc++ is to go into your miniconda directory and force it to use the system libstdc++:
|
@joshua-cogliati-inl's work around is functional. It's probably better to make modification in the virtual environment one is using to back-up previous shared objects: cd $CONDA_PREFIX/envs/your_env/lib
# Verify that `_ZSt28__throw_bad_array_new_lengthv` is missing in the target shared object
objdump -T libstdc++.so.6.0.28 | grep throw_bad_array
# Back-up the target shared object
mv libstdc++.so.6.0.28 libstdc++.so.6.0.28.old
# Change the target to point on the system's
ln -s /usr/lib64/libstdc++.so.6.0.29 libstdc++.so.6.0.28 |
StdVectorSentinel makes a proper life-cycle management for std::vectors' buffers possible. Duplication seems needed as fused types can't be used as attributes. It's possible to obtain a missing symbol (`_ZSt28__throw_bad_array_new_lengthv`) at runtime. This is unrelated to the implementation here, and there are issues reporting the problem, e.g.: cython/cython#4218. A temporary workaround: stan-dev/pystan#294 (comment)
StdVectorSentinel makes a proper life-cycle management for std::vectors' buffers possible. Duplication seems needed as fused types can't be used as attributes. It's possible to obtain a missing symbol (`_ZSt28__throw_bad_array_new_lengthv`) at runtime. This is unrelated to the implementation here, and there are issues reporting the problem, e.g.: cython/cython#4218. A temporary workaround: stan-dev/pystan#294 (comment)
Seems like people still come from Google over to this issue with conda-related compiler issues. Thus I wanted to give a piece of brief information on how to fix these problems.
|
That is backwards. The standard (C/C++) libraries have strong backwards compatibility. If you have a new one shadowing the system one, things will work with an old compiler from outside the environment. The problem arises when you have an old one in the environment shadowing the new one that the compiler outside the environment is expecting. |
Yes, that is why you will see a linker error if you compile with your system compiler and link against libraries coming from conda(-forge). These will use newer symbols but the system compiler tries to link with the system |
Thanks!! I have the same error info but I use Cython to wrap C++ vector, remove anaconda environment but use other python can resolve my problem. |
For others running into this that are not using conda: I resolved this by upgrading from Ubuntu 20.04 to Ubuntu 22.04. |
I had the issue after upgrading from Ubuntu 20.04 to Ubuntu 22.04. I solved this by removing torch_scatter, updating conda (conda update --all) so the c-compiler and cxx-compiler versions of anaconda and system matched, and then installing torch_scatter. |
After installing
pystan
and running the8schools
example, the compilation crashes with error messageI'm running Fedora 34, I tried both the most recent python version and 3.7.10. Any idea what's wrong? I couldn't find anything by googling the above error.
The text was updated successfully, but these errors were encountered: