Skip to content
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

Check /lib64/libstdc++.so.6: version GLIBCXX_3.4.20', GLIBCXX_3.4.21' by default #347

Closed
mengjuleu opened this issue Mar 27, 2019 · 24 comments

Comments

@mengjuleu
Copy link

Description

In 1.408-vsc1.32.0, it seems code-server check GLIBCXX_3.4.20 and GLIBCXX_3.4.21 before anything starts. Therefore, it's almost impossible to run code-server in CentOS 7. We can run code-server 1.32.0-310 by replacing spdlog.node in $HOME/.local/share/code-server/dependencies. Is there any similar way in 1.408-vsc1.32.0?

@JavanTang
Copy link

apt-get install software-properties-common
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get upgrade
apt-get install gcc-4.9
apt-get upgrade libstdc++6

Have you changed the dockerfile?

@mengjuleu
Copy link
Author

@JavanTang I used CentOS 7

@JavanTang
Copy link

@mengjuleu You can use yum to install apt and then use those commands. I have not tried it, just give a way.

@robopuff
Copy link

@JavanTang That is least effective way to do it in any other distro than Ubuntu. I have for example a Debian Jessie (Debian 8) and solution provided by you won't work at all.

@jakegt1
Copy link

jakegt1 commented Mar 28, 2019

Seems that the binary itself needs that glibc version now.

It would be nice if the binaries were actually built on CentOS (or a different flavour of linux with older GCC) so CentOS users could also use code-server.

The docker implementation is nice, but it's not great for long-lived usage.

@lunedam-git
Copy link

Was genuinely excited about this until I discovered that it wouldn't run on CentOS 7. Such a shame. Hopefully a binary compiled for people who dare to not use Ubuntu will become available 😉

@mengjuleu
Copy link
Author

mengjuleu commented Mar 31, 2019

Well, I finally found a way. I compiled and installed gcc 8.3 on my CentOS 7 box. Then create symLink to the newer libstdc++.so.6 under /lib64 so that code-server can pick up the newer version of c++ lib.

BTW, compiling code-server on CentOS 7 box won't help, it'll still show the same error message when launching.

@ymmt2005
Copy link

Linking with g++ -static-libgcc -static-libstdc++ may help.

@mischajonker
Copy link

It seems that in the most recent binary drop, the environment is not passed correctly when creating the shared process. This causes LD_LIBRARY_PATH to not be passed, which results into the error message related to GLIBCXX_3.4.20 if you're running on CentOS 7.
It worked fine with the v1.31.1-100 binary drop.

When doing a strace -ff, you will see:
strace.pid.14450:execve("....../code-server/code-server", ["..../code-ser"..., "/home/travis/build/codercom/code"..., "--bootstrap-fork", "vs/code/electron-browser/sharedP"..., "--extra-args", "[]", "--data-dir", "......./.local/share/code-ser"...], [/ 3 vars */]*) = 0

So, only 3 variables are passed as environment to execve syscall, while I have 159 in my environment...

@mengjuleu
Copy link
Author

@mischajonker Yeah, I found the same thing. So, the shared process cannot catch up LD_LIBRARY_PATH env var. So, I still need to create symLink lin /lib64 which is dangerous.

@mischajonker
Copy link

... and not to mention that creating a symLink in /lib64 requires root, which I don't have. Perhaps we need to change this issue from "question" to "bug".

@Gr33nChip
Copy link

... and not to mention that creating a symLink in /lib64 requires root, which I don't have. Perhaps we need to change this issue from "question" to "bug".

I agree, it looks like it have effected all centos users. :( i dont want to change os just to get this to work :(

@jeasonstudio
Copy link
Contributor

... and not to mention that creating a symLink in /lib64 requires root, which I don't have. Perhaps we need to change this issue from "question" to "bug".

Also urgent label.

@mal2
Copy link

mal2 commented Apr 8, 2019

I had the same problem on debian jessie, i think i fixed it by adding -D_GLIBCXX_USE_CXX11_ABI=0 to the "cflags" in code-server/packages/protocol/node_modules/spdlog/build/config.gypi
...
3 "target_defaults": {
4 "cflags": ["-D_GLIBCXX_USE_CXX11_ABI=0"],
5 "default_configuration": "Release",
...

but got the SyntaxError: Unexpected end of JSON input error now

@zfy1989lee
Copy link

Linking with g++ -static-libgcc -static-libstdc++ may help.

Could you give us a sample command?

@enniosousa
Copy link

Hello!

I was able to install on CentOS

I have a server with CentOS Linux release 7.6.1810 (Core) arch x86_64 and I finally make code-server works on it.

1

After follow default intalation's tutorial, when i tryed start the code-server o got this error
Output

./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./code-server)
./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./code-server)

2

So I had tried check provides versions avaliable at /lib64/libstdc++.so.6 and I got the prompt bellow, and really was missing the provider GLIBCXX_3.4.20 and GLIBCXX_3.4.21
PS: /lib64 is a symbolic link to /usr/lib64

Command

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

Output

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

3

My natural action was update the version of libstdc++ and was show up me a message tha already installed and latest version.

Command

sudo yum install libstdc++

Output

Loaded plugins: fastestmirror, replace
Repository packages-microsoft-com-prod is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: linorg.usp.br
 * epel: espejito.fder.edu.uy
 * extras: linorg.usp.br
 * remi-php72: remi.xpg.com.br
 * remi-safe: remi.xpg.com.br
 * updates: linorg.usp.br
 * webtatic: us-east.repo.webtatic.com
Package libstdc++-4.8.5-36.el7_6.1.x86_64 already installed and latest version
Nothing to do

4

I looked for a repository to CentOS 7 with updated library avaliable I had not success :(

5

So I had tried to find a library libstdc++ installed on my server; for my luck I found one used by Anaconda (a Python/R Data Science Platform)

Command

sudo find / -name "libstdc++.so.6*"

Output

/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/jorge/anaconda3/pkgs/libgcc-7.2.0-h69d50b8_2/lib/libstdc++.so.6.0.21
/home/jorge/anaconda3/lib/libstdc++.so.6
/home/jorge/anaconda3/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/lib/libstdc++.so.6.0.21
/home/jorge/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/jorge/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.19
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19
/usr/lib64/libstdc++.so.6.bkp
/usr/lib64/libstdc++.so.6.0.25
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.pyo
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6.0.25
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/opt/anaconda3/pkgs/libgcc-7.2.0-h69d50b8_2/lib/libstdc++.so.6.0.21
/opt/anaconda3/lib/libstdc++.so.6
/opt/anaconda3/lib/libstdc++.so.6.0.25
/opt/anaconda3/lib/libstdc++.so.6.0.21
/opt/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/opt/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25

The library version that we need is /opt/anaconda3/lib/libstdc++.so.6.0.25 listed previously. So I copied the lib to /usr/lib64

Command

sudo cp /opt/anaconda3/lib/libstdc++.so.6.0.25 /usr/lib64/

After I mode the symbolic link /usr/lib64/libstdc++.so.6 to /usr/lib64/libstdc++.so.6.bkp

Command

sudo mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bkp

My lastest step was create a symbolic link

Command

sudo ln -s /usr/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6

5

Now try run the code-server

@mengjuleu
Copy link
Author

@enniosousa How do you get /opt/anaconda3/lib/libstdc++.so.6.0.25 in CentOS? I guess you compile and install newer gcc by yourself, right?

@enniosousa
Copy link

enniosousa commented Apr 12, 2019

@mengjuleu the /opt/anaconda3/lib/libstdc++.so.6.0.25 is part of Anaconda . A colleague had installed before I try run code-server, so wasn't me that has compiled and installed.

I asked to him. He told me that had downloaded the Anaconta Python 3.7 version and installed manually

@kylecarbs
Copy link
Member

Duplicate of #239

@kylecarbs kylecarbs marked this as a duplicate of #239 Apr 25, 2019
@kiemrong08
Copy link

kiemrong08 commented Jun 28, 2019

I resolved this issue by install gcc-9.1.0 (gcc-9.1.0.tar.gz) manually in CentOS 7.
https://gcc.gnu.org/mirrors.html

My version: code-server1.1156-vsc1.33.1-linux-x64

@anishagartia
Copy link

I followed all of @enniosousa 's steps. rpm -ivh or yum install still cant find resolve this dependency. Added /usr/lib64 to $LD_LIBRARY_PATH as well.

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

gives me

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25

Error:

Error: Package: bazel2-2.0.0-2.el7.x86_64 (/bazel2-2.0.0-2.el7.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.22)(64bit)
Error: Package: bazel2-2.0.0-2.el7.x86_64 (/bazel2-2.0.0-2.el7.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
Error: Package: bazel2-2.0.0-2.el7.x86_64 (/bazel2-2.0.0-2.el7.x86_64)
           Requires: libstdc++.so.6(GLIBCXX_3.4.23)(64bit)

@nhooyr
Copy link
Contributor

nhooyr commented Jun 13, 2020

@anishagartia This is the issue tracker for code-server, not bazel.

@hadpro24
Copy link

Hello!

I was able to install on CentOS

I have a server with CentOS Linux release 7.6.1810 (Core) arch x86_64 and I finally make code-server works on it.

1

After follow default intalation's tutorial, when i tryed start the code-server o got this error
Output

./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./code-server)
./code-server: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./code-server)

2

So I had tried check provides versions avaliable at /lib64/libstdc++.so.6 and I got the prompt bellow, and really was missing the provider GLIBCXX_3.4.20 and GLIBCXX_3.4.21
PS: /lib64 is a symbolic link to /usr/lib64

Command

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

Output

GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_DEBUG_MESSAGE_LENGTH

3

My natural action was update the version of libstdc++ and was show up me a message tha already installed and latest version.

Command

sudo yum install libstdc++

Output

Loaded plugins: fastestmirror, replace
Repository packages-microsoft-com-prod is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: linorg.usp.br
 * epel: espejito.fder.edu.uy
 * extras: linorg.usp.br
 * remi-php72: remi.xpg.com.br
 * remi-safe: remi.xpg.com.br
 * updates: linorg.usp.br
 * webtatic: us-east.repo.webtatic.com
Package libstdc++-4.8.5-36.el7_6.1.x86_64 already installed and latest version
Nothing to do

4

I looked for a repository to CentOS 7 with updated library avaliable I had not success :(

5

So I had tried to find a library libstdc++ installed on my server; for my luck I found one used by Anaconda (a Python/R Data Science Platform)

Command

sudo find / -name "libstdc++.so.6*"

Output

/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/jorge/anaconda3/pkgs/libgcc-7.2.0-h69d50b8_2/lib/libstdc++.so.6.0.21
/home/jorge/anaconda3/lib/libstdc++.so.6
/home/jorge/anaconda3/lib/libstdc++.so.6.0.25
/home/jorge/anaconda3/lib/libstdc++.so.6.0.21
/home/jorge/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/jorge/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/usr/lib/libstdc++.so.6
/usr/lib/libstdc++.so.6.0.19
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19
/usr/lib64/libstdc++.so.6.bkp
/usr/lib64/libstdc++.so.6.0.25
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib/libstdc++.so.6.0.19-gdb.pyo
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6.0.25
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/lib/libstdc++.so.6
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25
/opt/anaconda3/pkgs/libstdcxx-ng-8.2.0-hdf63c60_1/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/opt/anaconda3/pkgs/libgcc-7.2.0-h69d50b8_2/lib/libstdc++.so.6.0.21
/opt/anaconda3/lib/libstdc++.so.6
/opt/anaconda3/lib/libstdc++.so.6.0.25
/opt/anaconda3/lib/libstdc++.so.6.0.21
/opt/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/opt/anaconda3/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.25

The library version that we need is /opt/anaconda3/lib/libstdc++.so.6.0.25 listed previously. So I copied the lib to /usr/lib64

Command

sudo cp /opt/anaconda3/lib/libstdc++.so.6.0.25 /usr/lib64/

After I mode the symbolic link /usr/lib64/libstdc++.so.6 to /usr/lib64/libstdc++.so.6.bkp

Command

sudo mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.bkp

My lastest step was create a symbolic link

Command

sudo ln -s /usr/lib64/libstdc++.so.6.0.25 /usr/lib64/libstdc++.so.6

5

Now try run the code-server

Thanks. It's work for me

@velvet2017
Copy link

Thanks a lot bro....you really saved my ass with your idea

@coder coder locked as resolved and limited conversation to collaborators Sep 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests