YourKit Internal Error

Questions about YourKit Java Profiler
Post Reply
puzzlerme
Posts: 3
Joined: Sun Jan 29, 2023 11:32 pm

YourKit Internal Error

Post by puzzlerme »

Hi -

My FRC team recently downloaded YourKit. We use a RoboRIO 2 running NI Linux (arm-32) and we were hoping to profile our code by connecting to it remotely using SSH. Unfortunately, when it tries to connect it gives us an "Internal Error" error, and when we run the agent manually (via

Code: Select all

java -agentpath:<full agent library path>=help
from https://www.yourkit.com/docs/java/help/agent.jsp), we get the same error without any further detail. We found the logs and couldn't figure out how to fix the error. Here are the logs: https://pastebin.com/7C7W7Gp5. We would really appreciate any help you might have to offer with this!

Thanks!
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit Internal Error

Post by Anton Katilin »

Hi,

You've provided the log of the profiler UI. The profiled process tries to attach the agent to a running JVM instance, and fails for some yet unclear reason.

When you specify -agentpath in the command line, what is the exact console output?

Is the profiler agent log file <user home>/.yjp/log/<name>-<pid>.log created? If yes, what is its content?

What is the output of the following commands from the ARM host:

uname -a
java -version
java -agentpath:<path to the agent> -version
ldd -r <path to the agent>
puzzlerme
Posts: 3
Joined: Sun Jan 29, 2023 11:32 pm

Re: YourKit Internal Error

Post by puzzlerme »

Hi -

Here are all of the commands (ran on the arm32 device):

Code: Select all

admin@roborio-4904-FRC:/# /usr/local/frc/JRE/bin/java -agentpath:/home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so=help
Error occurred during initialization of VM
Could not find agent library /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so in absolute path, with error: /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so: internal error

Code: Select all

admin@roborio-4904-FRC:/# uname -a
Linux roborio-4904-FRC 4.14.146-rt67 #1 SMP PREEMPT RT Thu Jul 1 17:06:10 UTC 2021 armv7l GNU/Linux

Code: Select all

admin@roborio-4904-FRC:/# /usr/local/frc/JRE/bin/java -version
openjdk version "11.0.9.11-frc" 2020-10-20
OpenJDK Runtime Environment (build 11.0.9.11-frc+0-2021-11.0.9u11-1)
OpenJDK Client VM (build 11.0.9.11-frc+0-2021-11.0.9u11-1, mixed mode)

Code: Select all

admin@roborio-4904-FRC:/# /usr/local/frc/JRE/bin/java -agentpath:/home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so -version
Error occurred during initialization of VM
Could not find agent library /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so in absolute path, with error: /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so: internal error

Code: Select all

admin@roborio-4904-FRC:/# ldd -r /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so
ldd: warning: you do not have execution permission for `/home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so'
        not a dynamic executable
Just to confirm, is the -agentpath command supposed to be run on the ARM host or not? We never actually got around to specifying -agentpath on start of the Java application we were trying to profile as simply running a test command firing up the JVM with the flag in general failed with the error message that's shown above. We couldn't find any folder with that structure on the RoboRIO (although it does look like the log folder structure for the client machine, but as I mentioned, we never actually got to properly running it).

Thanks in advance for your help!
Vladimir Kondratyev
Posts: 1619
Joined: Tue Aug 10, 2004 7:52 pm

Re: YourKit Internal Error

Post by Vladimir Kondratyev »

Is /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so a correct path to the profiler agent? What is the output of ldd -v /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit Internal Error

Post by Anton Katilin »

Just to confirm, is the -agentpath command supposed to be run on the ARM host or not?
-agentpath is a Java command line option. It instructs the JVM to load the specified agent library.

To ensure you properly specified the path, please try running

file /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so
puzzlerme
Posts: 3
Joined: Sun Jan 29, 2023 11:32 pm

Re: YourKit Internal Error

Post by puzzlerme »

Hi -
Is /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so a correct path to the profiler agent? What is the output of ldd -v /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so?

Code: Select all

lvuser@roborio-4904-FRC:~$ ldd -v /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so 
ldd: warning: you do not have execution permission for `/home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so'
	not a dynamic executable

Code: Select all

lvuser@roborio-4904-FRC:~$ ldd --version
ldd (GNU libc) 2.24
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
file /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/libyjpagent.so
Our ARM host is equipped with a lightweight NI Linux variant which unfortunately does not have the file command, but we can validate its existence with the following:

Code: Select all

lvuser@roborio-4904-FRC:~$ ls /home/lvuser/.yjp/2022.9-b177/bin/linux-arm-32/   
libattach.so    libyjpagent.so
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: YourKit Internal Error

Post by Anton Katilin »

ldd writes the message "not a dynamic executable" in case of architecture mismatch.
Perhaps bin/linux-arm-32/libyjpagent.so is targeted to the architecture which is newer or in some other way incompatible with yours.

The library requires ARMv7 and higher, it uses hard-float.
glibc version 2.12 and higher is needed.

All seems OK except for maybe the hard-float requirement. Is this requirement satisfied?

As an experiment, please try if an older version's agent runs in your case:
https://www.yourkit.com/download/archive.jsp

It makes sense to start from the oldest presented version 2013. It has a dedicated soft-float agent, please give it a try to check if it's an ABI issue.
Post Reply