Yourkit & Alpine?

Questions about YourKit Java Profiler
Post Reply
veritas
Posts: 2
Joined: Fri Jan 26, 2018 11:58 pm

Yourkit & Alpine?

Post by veritas »

I'm running a docker container based on gliderlabs/alpine:3.3, which then has a JVM app that I'd like to connect yourkit up to. After installing libc6-compat on the container, I still get errors trying to start the agent:

Code: Select all

# ./yjp.sh -attach 12
(bunch of stuff)
Caused by: java.lang.UnsatisfiedLinkError: /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so: Error relocating /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so: backtrace_symbols: symbol not found
Further explained by:

Code: Select all

# ldd /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so
ldd (0x7f238d915000)
	librt.so.1 => ldd (0x7f238d915000)
	libdl.so.2 => ldd (0x7f238d915000)
	libm.so.6 => ldd (0x7f238d915000)
	libc.so.6 => ldd (0x7f238d915000)
	ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f238d109000)
Error relocating /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so: backtrace_symbols: symbol not found
Error relocating /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so: backtrace: symbol not found
Is there an alpine / musl version of yourkit available, or will there be one in the future?

thanks!
pbeaumont
Posts: 1
Joined: Fri Feb 02, 2018 3:19 pm

Re: Yourkit & Alpine?

Post by pbeaumont »

+1 For support of Alpine by Yourkit...
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

Hi All,

We're considering Alpine Linux support, so could you please answer a few questions:

- On which platform(s) do you want to profile on Alpine? Will x86_64 be enough?
- Which Java version do you use? Could you please provide the output of "java -version".

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

Update:

We've tried the latest Alpine Linux 3.7.0 (Released Nov 30, 2017) for x86_64. It works for us with YourKit Java Profiler just fine after installing libc6-compat:

Code: Select all

sudo apk add libc6-compat
Both the profiler agent and the profiler UI seem to work. At least we didn't notice any problem after short testing.

To let it work with the current profiler build of version 2017.02, we had to remove the directory <YourKit installation directory>/jre64 containing a bundled JRE for a "normal" Linux which is incompatible with Alpine, to ensure that existing yjp.sh and other profiler scripts use the Java installed on your system.

@veritas:

We also found other people experiencing similar "symbol not found" issues (with other software, not with the profiler) with docker on Alpine. Adding the following snippet to the docker file helped them:
https://github.com/jeanblanchard/docker ... Dockerfile

[Edited] It seems we've created a better solution. Please see my comments below.
dmun
Posts: 1
Joined: Thu Feb 01, 2018 9:07 pm

Re: Yourkit & Alpine?

Post by dmun »

Another big vote for Alpine support. If your hoping to keep us YK fans happy then Alpine + Docker support is critical. FWIW the above workaround seems to work but it's going to be hard to convince people that we need to update our Dockerfile to get YK to work ... when I don't need to do the same for JProfiler.

I've been a YK fan for many years and brought it in to our tool set at a number of previous companies. Your making it a hard sell today without easy support for Alpine. Here's hoping you can offer a quick - clean -
solution.

As for previous questions, X86 64 bit and Java is:

Code: Select all

/var/lib/jetty $ java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (IcedTea 3.6.0) (Alpine 8.151.12-r0)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

Hello dmun,

Thank you for the feedback. It's valuable to us.

Yes, we consider adding out-of-the box support for Alpine, but until it's ready it's important to know that a workaround exists.

Best regards,
Anton
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

Hi all,

Another question: which Java docker image do you use?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

@veritas: possible fix for your issue

Does this agent solve the problem?
https://www.yourkit.com/download/tmp/20 ... jpagent.so
veritas
Posts: 2
Joined: Fri Jan 26, 2018 11:58 pm

Re: Yourkit & Alpine?

Post by veritas »

Things are looking good - copying libyjpagent.so into /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/ makes the loader happy (libc6-compat is also required, of course):

Code: Select all

/ # ldd /YourKit-JavaProfiler-2017.02/bin/linux-x86-64/libyjpagent.so
	ldd (0x7faae73a6000)
	librt.so.1 => ldd (0x7faae73a6000)
	libdl.so.2 => ldd (0x7faae73a6000)
	libm.so.6 => ldd (0x7faae73a6000)
	libc.so.6 => ldd (0x7faae73a6000)
	ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7faae6b99000)
Then setting YJP_JAVA_HOME accordingly, and we are in business!

For completeness, here's the version of java currently in use on this docker image:

Code: Select all

/ # java -version
openjdk version "1.8.0_92-internal"
OpenJDK Runtime Environment (build 1.8.0_92-internal-alpine-r0-b14)
OpenJDK 64-Bit Server VM (build 25.92-b14, mixed mode)
thanks!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Yourkit & Alpine?

Post by Anton Katilin »

FYI: v2017.02 build 75 with the fix is available for download.
Post Reply