jvm-profiling-tools / ap-loader

Packages async-profiler with binaries for all platforms in a single JAR
Apache License 2.0
130 stars 10 forks source link

Async-profiler does not work with the given libc #2

Closed pinahar closed 1 year ago

pinahar commented 1 year ago

Getting this error with the latest release

~ # java -jar ap-loader-linux-x64.jar profiler -d 60 1 Exception in thread "main" java.lang.IllegalStateException: Async-profiler does not work with the given libc at one.profiler.AsyncProfilerLoader.getLibrarySuffix(AsyncProfilerLoader.java:147) at one.profiler.AsyncProfilerLoader.getAsyncProfilerFileName(AsyncProfilerLoader.java:227) at one.profiler.AsyncProfilerLoader.isSupported(AsyncProfilerLoader.java:269) at one.profiler.AsyncProfilerLoader.checkCommandAvailability(AsyncProfilerLoader.java:645) at one.profiler.AsyncProfilerLoader.main(AsyncProfilerLoader.java:666)

I see that a fix has been committed but the release has not been updated maybe?

parttimenerd commented 1 year ago

Thanks, I updated it. Can you try again?

pinahar commented 1 year ago

Getting a new error now - ~ # java -jar ap-loader-linux-x64.jar profiler -d 60 1 Exception in thread "main" java.io.IOException: Cannot run program "/root/.local/share/ap-loader-2.8.3/profiler.sh": error=2, No such file or directory at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071) at java.base/java.lang.Runtime.exec(Runtime.java:592) at java.base/java.lang.Runtime.exec(Runtime.java:494) at one.profiler.AsyncProfilerLoader.executeProfilerInteractively(AsyncProfilerLoader.java:466) at one.profiler.AsyncProfilerLoader.main(AsyncProfilerLoader.java:659) Caused by: java.io.IOException: error=2, No such file or directory at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) at java.base/java.lang.ProcessImpl.(ProcessImpl.java:340) at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271) at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107) ... 5 more

I checked and this file does exist. I think the problem is that I'm running this on a distroless java debug image which has busybox shell and not bash. The only way to run the profiler.sh file is to run it with 'sh profiler.sh'.

Is there any good way for me to make this work?

parttimenerd commented 1 year ago

I hopefully fixed it.

Please open a new issue the next time.

pinahar commented 1 year ago

It works now. Thanks a lot.