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

Running agent without libstdc++ #84

Closed
rrva opened this issue Mar 21, 2023 · 5 comments
Closed

Running agent without libstdc++ #84

rrva opened this issue Mar 21, 2023 · 5 comments

Comments

@rrva
Copy link

rrva commented Mar 21, 2023

Using agent 0.11.1 with the docker base image amazoncorretto:19.0.2-alpine3.17 I get the following error:

Exception in thread "main" java.lang.UnsatisfiedLinkError: /tmp/?-pyroscope/libasyncProfiler-linux-musl-x64-f6ab1a383549585b63e2b7869345eafc0dca778.so: Error loading shared library libstdc++.so.6: No such file or directory (needed by /tmp/?-pyroscope/libasyncProfiler-linux-musl-x64-f6ab1a383549585b63e2b7869345eafc0dca778.so

Switching the docker base image to eclipse-temurin:19_36-jdk resolves the problem.

Can libstdc++ be linked statically into libasyncProfiler ? That way we can use a java base image which lacks it.

@korniltsev
Copy link
Collaborator

eclipse-temurin:19_36-jdk is based on Ubuntu 22.04 , not alpine. It has libstdc++ installed under /lib/x86_64-linux-gnu/libstdc++.so.6

amazoncorretto:19.0.2-alpine3.17 is based on alpine and has no libstdc++ installed
you can add it by apk add libstdc++

While it is probably possible(I am not sure) to link c++ statically I would prefer not to do it (even try) just because genuine async-profiler does not do it and we want to be as close as possible to the upstream

@rrva
Copy link
Author

rrva commented Mar 21, 2023

Opened async-profiler/async-profiler#729

@rmak-cpi
Copy link

While my scenario is not 100% the same, I actually got pyroscope java agent to work with adoptopenjdk/openjdk8:jre${java_version}-alpine image. It looks like the adopenjdk image has libstdc++.so.6 installed at /usr/glibc-compat/lib/libstdc++.so.6. Perhaps it is possible to install libstdc++ on corretto image via apk add libstdc++?

https://pkgs.alpinelinux.org/packages?name=libstdc%2B%2B&branch=edge&repo=&arch=&maintainer=

@rrva
Copy link
Author

rrva commented Mar 21, 2023

While my scenario is not 100% the same, I actually got pyroscope java agent to work with adoptopenjdk/openjdk8:jre${java_version}-alpine image. It looks like the adopenjdk image has libstdc++.so.6 installed at /usr/glibc-compat/lib/libstdc++.so.6. Perhaps it is possible to install libstdc++ on corretto image via apk add libstdc++?

https://pkgs.alpinelinux.org/packages?name=libstdc%2B%2B&branch=edge&repo=&arch=&maintainer=

The idea behind this issue is to not have to customize the base docker image at all, but still run the agent. For these cases it should work with whatever the base alpine image contains, which is no libstdc++

@korniltsev
Copy link
Collaborator

I will close this issue for now. We will update AP once the upstream issue is addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants