2

Running RHEL 7.7 on the head node of a compute cluster. When I open VS Code 1.57.1 it hangs on the intro screen. Running with $ code --verbose, it shows the error: /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.20 not found. I have to kill -9 the hanging code process. Google tells me that the new version of VS Code uses Electron that requires the updated GLIBCXX version.

The installed version in /usr/lib64/libstdc++ is definitely out of date, and I can't update it. But I do have a newer version of GCC that is loaded by the $ module load gcc8/8.4.0 command that loads GCC from /cm/shared/apps/gcc8/8.4.0/. The library /cm/shared/apps/gcc8/8.4.0/lib64/libstdc++.so.6 has the requested version of GLIBCXX.

I have tried loading gcc8 before running code, but that doesn't change the error.

Is there a way to make VS Code use the alternative location for libstdc++.so.6? Is there an alternative to updating the system-wide libstdc++.so.6 library?

This is the full error message from --verbose:

Error: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /usr/share/code/resources/app/node_modules.asar.unpacked/spdlog/build/Release/spdlog.node) at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)

This shows the out-of-date default version of libstdc++:

$ strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
...
GLIBCXX_3.4.18
GLIBCXX_3.4.19   <----Nope, this version is too old!
GLIBCXX_DEBUG_MESSAGE_LENGTH

This shows the other libstdc++ library has the required version:

$ strings /cm/shared/apps/gcc8/8.4.0/lib64/libstdc++.so.6 | grep GLIBCXX
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
...
GLIBCXX_3.4.19
GLIBCXX_3.4.20   <--- Here it is!
GLIBCXX_3.4.21
...
GLIBCXX_3.4.25
GLIBCXX_DEBUG_MESSAGE_LENGTH
Aaron Caba
  • 73
  • 8
  • /usr/lib64/libstdc++.so.6 is a symbolic link to /usr/lib64/libstdc++.so.6.0.19, `rm -f /usr/lib64/libstdc++.so.6 ` just try to delete this link and recreate it pointing to /cm/shared/apps/gcc8/8.4.0/lib64/libstdc++.so.6: `ln -sv /cm/shared/apps/gcc8/8.4.0/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6` – scroveez Jul 05 '21 at 14:16
  • Thank you so much @scroveez, that was indeed my problem. I spelled out my solution in the answer below. – Aaron Caba Jul 06 '21 at 19:31

1 Answers1

2

Per scroveez's suggestion, the /usr/lib64/libstdc++.so.6 was indeed a symlink to the older version. To fix it I copied the 'new' version 25 library into /usr/lib64/ and changed the symlink to point to the newer version.

$ ll /usr/lib/libstdc++.so.*
lrwxrwxrwx 1 root root      18 Apr 30  2019 /usr/lib/libstdc++.so.5 -> libstdc++.so.5.0.7
-rwxr-xr-x 1 root root  739520 Nov 13  2014 /usr/lib/libstdc++.so.5.0.7
lrwxrwxrwx 1 root root      19 Jul  6 08:56 /usr/lib/libstdc++.so.6 -> libstdc++.so.6.0.25
-rwxr-xr-x 1 root root  934644 Mar 25  2020 /usr/lib/libstdc++.so.6.0.19
-rwxr-xr-x 1 root root 1570176 Jul  6 08:55 /usr/lib/libstdc++.so.6.0.25
$
Aaron Caba
  • 73
  • 8