question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

issues including libstdc++ (or how to get eaten by a grue)

See original GitHub issue

I just installed the Debian package of code server on Ubuntu Eoan and any C++ application that tries to run as a child of code server is now broken with the following error:

cmake: /usr/lib/code-server/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by cmake)
cmake: /usr/lib/code-server/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.22' not found (required by cmake)
cmake: /usr/lib/code-server/bin/../lib/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by cmake)
cmake: /usr/lib/code-server/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by cmake)
cmake: /usr/lib/code-server/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /lib/x86_64-linux-gnu/libjsoncpp.so.1)

This is because the libstdc++ included is only at ABI level CXXABI_1.3.8 and in my case, libjsoncpp was linked against a symbol first only found in CXXABI_1.3.9. If I remove that libstdc++ from code it all works again.

Traditionally statically linking (or just flat out including) libstdc++ is a disaster.

<rant> Why it is 2020 and this has been a problem for since the first time we had dynamic linking can only be attributed to the C++ standards committee hating people who ship software and the GCC authors being sadists who enjoy torturing kitten when they are not torturing developers. While #1706 was a noble dream, it will break so much more than you will fix, your hampster will leave you, your house will burn down, you will die alone, and more than likely be writing a bug report like this in 5 years for someone else’s project.
</rant>

In the end, what people end up doing is either run the entire application stack with the same versions aka flatpak/snap, or they go the appimage route and compile against the oldest version of libstdc++ they can compile on. The issue with flatpak/snap approach is fraught with danger in something like code-server since it will run toolchains and other things inside of a different env. One approach might be to use the above link along with some magic to take the parent library path and then pass that down into the child environments when tasks run. See http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths for the first steps down the path to that madness. In my tortured experience of packaging C++ software on Linux for the last 15 years, you are best off with the link your app against the oldest libc++ you can possibly support and hope for the best 😦 https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html has the details you need to start down that path.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
nhooyrcommented, May 28, 2020

Why it is 2020 and this has been a problem for since the first time we had dynamic linking can only be attributed to the C++ standards committee hating people who ship software and the GCC authors being sadists who enjoy torturing kitten when they are not torturing developers. While #1706 was a noble dream, it will break so much more than you will fix, your hampster will leave you, your house will burn down, you will die alone, and more than likely be writing a bug report like this in 5 years for someone else’s project.

😂 facts

Sorry about this, but I think we can safely fix it but unsetting DYLD_LIBRARY_PATH and LD_LIBRARY_PATH after code-server starts up. That way any application you run will not inherit our modified variables.

0reactions
nhooyrcommented, Jun 4, 2020

New release is out!

Read more comments on GitHub >

github_iconTop Results From Across the Web

issues including libstdc++ (or how to get eaten by a grue) #1738
I just installed the Debian package of code server on Ubuntu Eoan and any C++ application that tries to run as a child...
Read more >
Bug List - GCC, the GNU Compiler Collection
It is pitch black. You are likely to be eaten by a grue. Hide Search Description. Component: bootstrap; Status: UNCONFIRMED, NEW, ASSIGNED, SUSPENDED,...
Read more >
How to Avoid Being Eaten by a Grue: Structured Exploration ...
Standard Reinforcement Learning agents are poorly equipped to effectively explore such spaces and often struggle to overcome bottlenecks--- ...
Read more >
Untitled
Online chat sites with avatars, Gantz manga 367 submanga, Digiarty blu ray player review, Hjullager fram saab 9-5, Pool ball art, 17th edition...
Read more >
The Linux Gamers' HOWTO - FTP Directory Listing
with anything else on Linux, you need to know a little more about what's going on behind the ... It is pitch dark...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found