Chia-Network / chia-blockchain

Chia blockchain python implementation (full node, farmer, harvester, timelord, and wallet)
Apache License 2.0
10.81k stars 2.02k forks source link

[Bug] GLIBCXX_3.4.26 not found for Madmax after upgrade to 1.5.1 #13242

Closed TheLastCicada closed 2 years ago

TheLastCicada commented 2 years ago

What happened?

I've been plotting reliably with Madmax for a few months and yesterday upgraded to 1.5.1. Now when I run my same plotting command, I get the following error:

STDERR: /opt/chia/madmax/chia_plot: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /opt/chia/madmax/chia_plot)

The plotting command I'm using is (sensitive data has been anonymized):

chia plotters madmax -c xxxxxxxxxxxxxx -t  /chia-plots/tmp1 -2 /chia-plots/tmp2 -d /chia-plots/final_plots -r 3 -n 1 -u 256 -k 32

I'm installing the chia-blockchain-cli package via apt using the instructions from here https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL#install-using-the-repository.

Operating System:

Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:    22.04
Codename:   jammy

Ubuntu is fully patched.

When I removed Madmax and tried reinstalling it with chia plotters install madmax, I get a similar error:

Running install script.
cmake: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by cmake)
cmake: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by cmake)
cmake: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /lib/x86_64-linux-gnu/libjsoncpp.so.25)
cmake: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /lib/x86_64-linux-gnu/libjsoncpp.so.25)
./make_devel.sh: line 4: cd: build: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
Exception while installing madmax plotter: Error while running install script Command '['./make_devel.sh']' returned non-zero exit status 2.

UPDATE: Madmax installation works if I install from source. Madmax installation does NOT work if I install from the apt repository.

Version

1.5.1

What platform are you using?

Linux

What ui mode are you using?

CLI

Relevant log output

STDERR: /opt/chia/madmax/chia_plot: /opt/chia/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /opt/chia/madmax/chia_plot)
cmmarslender commented 2 years ago

Seems related to this issue https://github.com/pyinstaller/pyinstaller/issues/6993

On my test machine (arm64, ubuntu 20.04) removing the /opt/chia/libstdc++.so.6 file and then trying again solved the problem, but its not clear at this point if we'll run into issues with other supported platforms doing this.

Broken for me on the following versions (testing more):

Seems like this used to work for some of these older versions (per discussion with Zach) so maybe this is an issue with updated libstdc++ on the systems this is being installed on, and not being in sync or something with the version in the build image?

cmmarslender commented 2 years ago

Building from a 20.04 based docker image instead of the 18.04 based docker image resolved the issue for me, at least on 20.04 - I believe Zach will test 22.04 and report back.

pasha1st commented 2 years ago

On my test machine (arm64, ubuntu 20.04) removing the /opt/chia/libstdc++.so.6 file and then trying again solved the problem,

Thanks! Removing this lib solved the issue for me. x86_64, Ubuntu 20.04

cmmarslender commented 2 years ago

Did some investigating. From what I can tell, this was caused by the switch from the github provided 18.04 runners for intel debs to the docker container (since the 18.04 runner image from github is now deprecated). GitHub provided newer versions of g++ than we have in our builder container (they added 9 and 10), and 9 provides the version of the gnu c++ lib that madmax is expecting. This means (and I confirmed by spot checking an older release) that the arm64 deb has likely never actually worked with madmax.

Testing a fix by adding g++ 9 and 10 to our builder image in the same manner that github used to install in their 18.04 image https://github.com/Chia-Network/build-images/pull/24 🤞

cmmarslender commented 2 years ago

This is resolved now for future builds. The current release (1.6.0) still has the issue, but new builds and future releases should be fixed.

If you're using madmax and hitting this issue, you are likely ok to delete the library bundled with chia (/opt/chia/libstdc++.so.6) as long as your system has a copy installed that supports the required CXX version (but do so at your own risk). To check, you can do something like the following:

x86_64

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.26
GLIBCXX_3.4.26

ARM64

strings /usr/lib/aarch64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.26
GLIBCXX_3.4.26

As long as GLIBCXX_3.4.26 shows up in the output of the command (vs it being an empty result) you should have a system version installed that meets the requirements. (if strings is not installed, that can be installed with apt-get install binutils)