Issues between OpenJDK 11 and libstdc++
Issues between OpenJDK 11 and libstdc++
Hello. I have been using OpenJDK 11 with no problems to run my Tomcat servers, however, an user of this system made some changes recently and I am now completely unable to start Tomcat and I am not able to run Java packages either. When I try to check my Java version, this is what happens:
$ java --version
Error: dl failure on line 606
Error: failed /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/lib/server/libjvm.so, because /lib64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
I am completely lost on what to do. At first I thought it was something related to Java, so I tried reinstalling, but nothing changed. I realize that it is related to the libstdc++ libraries instead. I have very little experience with c++ libraries and after searching about this error for days I did not reach any conclusions.
Can someone please shed me some light on what could be the issue?
Thank you!
$ java --version
Error: dl failure on line 606
Error: failed /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/lib/server/libjvm.so, because /lib64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
I am completely lost on what to do. At first I thought it was something related to Java, so I tried reinstalling, but nothing changed. I realize that it is related to the libstdc++ libraries instead. I have very little experience with c++ libraries and after searching about this error for days I did not reach any conclusions.
Can someone please shed me some light on what could be the issue?
Thank you!
Re: Issues between OpenJDK 11 and libstdc++
Is your system fully up to date? If you run yum update are you offered any updates?
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Issues between OpenJDK 11 and libstdc++
Thank you for your reply, I did run the update command and there were several updates offered which I did, but the error still persists. I found the cause of it, I checked the history of one of our users and found out he did some changes to the system and I need some help figuring out if there is a way of undoing it. Here is the history:
It seems that he replaced my libstdc++.so.6 with libstdc++.so.0.28 and deleted the original one. Is there a way of fixing it? I am not familiar with c++ packages but it is affecting my Java libraries. Any help would be appreciated. Thank you!
Code: Select all
sudo yum -y install gcc
sudo yum -y install gcc-c++
sudo yum -y install gcc-gfortran
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
gcc --version
cd /usr/local/gcc/lib64
sudo find /-name "libstdc++.so*"
sudo find / -name "libstdc++.so*"
sudo ln -sf /usr/lib64/libstdc++.so.6.0.19
ifort -v
sudo ln -sf /usr/lib64/libstdc++.so.6.0.19 /usr/lib64/libstdc++.so.6
strings /usr/lib64/libstdc++.so.6 | grep GLIBC
sudo yum -y install centos-release-scl
sudo yum -y install devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils
scl enable devtoolset-7 bash
sudo source ~/.bashrc
sudo echo "source /opt/rh/devtoolset-7/enable">>/etc/profile
ifort -v
strings /lib64/libstdc++.so.6 | grep GLIBC
strings /lib64/libstdc++.so.6.0.19 | grep GLIBC
find / -name "libstdc++.so*"
sudo cp /home/user/matlab/sys/os/glnxa64/libstdc++.so.6.0.28 /lib64
cd /lib64
sudo rm -f libstdc++.so.6
sudo ln -s libstdc++.so.6.0.28 libstdc++.so.6
strings /lib64/libstdc++.so.6 | grep GLIBC
Re: Issues between OpenJDK 11 and libstdc++
Code: Select all
[root@centos7 ~]# rpm -qf /lib64/libstdc++.so.6
libstdc++-4.8.5-44.el7.x86_64
libstdc++ and that would overwrite the change made to that file and restore the correct one.
I suspect you should also remove this user's ability to run sudo!
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Re: Issues between OpenJDK 11 and libstdc++
Thank you very much for your reply! I have tried reinstalling libstdc++ but it seems that the issue is still persisting, I tried it twice and also restarted the machine but when I run:
It looks like the file is still corrupted, do you have any suggestions on what can be done? Is it possible to manually replace the libstdc++.so.6 file in a safe way?
Thank you!
Code: Select all
$ javac --version
Error: dl failure on line 606
Error: failed /usr/lib/jvm/java-11-openjdk-11.0.19.0.7-1.el7_9.x86_64/lib/server/libjvm.so, because /lib64/libstdc++.so.6: undefined symbol: __cxa_thread_atexit_impl
Thank you!
Re: Issues between OpenJDK 11 and libstdc++
What does the following command return:
It may return nothing.
You might want to clean up /etc/profile, removing the changes the user made.
Code: Select all
rpm -V libstdc++
You might want to clean up /etc/profile, removing the changes the user made.
Re: Issues between OpenJDK 11 and libstdc++
The command returns this:
Does it mean that when one of the Java libraries I use call for libstdc++, it is pointed towards /usr/lib64/libstdc++.so.6 instead of /lib64/libstdc++.so.6 ? I am trying to understand what the user has done, I never cleaned up changes before but looking at this previous commands he did try to source things to ~/.bashrc multiple times.
Code: Select all
$ rpm -V libstdc++
....L.... /usr/lib64/libstdc++.so.6
Re: Issues between OpenJDK 11 and libstdc++
The symlink is still wrong. And you should run rpm -V as root so that it has access to everything that it needs to read to verify that it is correct.$ rpm -V libstdc++
....L.... /usr/lib64/libstdc++.so.6
CentOS 8 died a premature death at the end of 2021 - migrate to Rocky/Alma/OEL/Springdale ASAP.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are dead, do not use them.
Use the FAQ Luke