code-server icon indicating copy to clipboard operation
code-server copied to clipboard

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

Open mengjuleu opened this issue 7 years ago • 24 comments

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?

mengjuleu avatar Mar 27 '19 04:03 mengjuleu

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?

LongQIByte avatar Mar 27 '19 06:03 LongQIByte

@JavanTang I used CentOS 7

mengjuleu avatar Mar 27 '19 06:03 mengjuleu

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

LongQIByte avatar Mar 27 '19 06:03 LongQIByte

@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.

robopuff avatar Mar 28 '19 09:03 robopuff

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.

jakegt1 avatar Mar 28 '19 12:03 jakegt1

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 :wink:

lunedam-git avatar Mar 30 '19 15:03 lunedam-git

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.

mengjuleu avatar Mar 31 '19 22:03 mengjuleu

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

ymmt2005 avatar Mar 31 '19 23:03 ymmt2005

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...

mischajonker avatar Apr 01 '19 10:04 mischajonker

@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.

mengjuleu avatar Apr 03 '19 21:04 mengjuleu

... 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".

mischajonker avatar Apr 04 '19 07:04 mischajonker

... 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 :(

Gr33nChip avatar Apr 06 '19 03:04 Gr33nChip

... 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.

jeasonstudio avatar Apr 08 '19 02:04 jeasonstudio

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

mal2 avatar Apr 08 '19 14:04 mal2

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

Could you give us a sample command?

zfy1989lee avatar Apr 12 '19 06:04 zfy1989lee

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

enniosousa avatar Apr 12 '19 18:04 enniosousa

@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?

mengjuleu avatar Apr 12 '19 18:04 mengjuleu

@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

enniosousa avatar Apr 12 '19 18:04 enniosousa

Duplicate of https://github.com/codercom/code-server/issues/239

kylecarbs avatar Apr 25 '19 17:04 kylecarbs

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

kiemrong08 avatar Jun 28 '19 01:06 kiemrong08