STAMP-project / docker-traces-xp

Experiment showing how to instrument docker images to produce traces
Apache License 2.0
1 stars 0 forks source link

Unable to generate traces: Exception in thread "main" com.sun.tools.attach.AgentLoadException #1

Open mboussaa opened 5 years ago

mboussaa commented 5 years ago

Hi Brice,

Thank you for the tutorial. It works fine with the ThingML use case. However, I am having some trouble to run it over the Proactive server.

The PID of ThingML running process is 941 and the one of Proactive server is 52. Running java -jar /libperfagent.jar 941 works fine and it generates the traces.txt file but not the case with my Java process 52 and I get the following exception. (I just changed that line to be able to run Proactive instead of ThingML, I kept all configs you defined in Dockerfile and so on)

root@1ac5038d8daa:/# java -jar /libperfagent.jar 941
root@1ac5038d8daa:/# java -jar /libperfagent.jar 52
Exception in thread "main" com.sun.tools.attach.AgentLoadException: 0
    at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:108)
    at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentPath(HotSpotVirtualMachine.java:128)
    at net.virtualvoid.perf.AttachOnce.loadAgent(AttachOnce.java:51)
    at net.virtualvoid.perf.AttachOnce.main(AttachOnce.java:34)

I know that the issue come from the profiler (or probably not), but I share it anyway. Maybe someone has an idea how to handle it.

I keep looking at it and provide updates.

brice-morin commented 5 years ago

So you do have this block in the Proactive Dockerfile?

RUN cd /root && wget https://github.com/jvm-profiling-tools/perf-map-agent/archive/master.zip && unzip master.zip && rm -f master.zip && \
    cd /root/perf-map-agent-master && \
    sed -i '/find_package(Java REQUIRED)/Q' CMakeLists.txt && \
    export PATH=$JAVA_HOME/bin:$PATH && cmake . && make && \
    cd src/java && javac -d ../../out *.java && cd ../../out && jar -cvfe libperfagent.jar net.virtualvoid.perf.AttachOnce net/virtualvoid/perf && \
    cd /root/perf-map-agent-master && \
    cp out/libperfmap.so /libperfmap.so && cp out/libperfagent.jar /libperfagent.jar && \
    rm -rf /root/perf-map-agent-master
mboussaa commented 5 years ago

Yes I didn't change anything, except the java command that runs Proactive