Async-profiler: MacOS library should be called libasyncProfiler.dylib

Created on 7 Dec 2020  路  4Comments  路  Source: jvm-profiling-tools/async-profiler

We have users complaining that JMH -prof async does not work on MacOS X.

I figured that is because JMH does System.loadLibrary("asyncProfiler"), which cannot find the library even with DYLD_LIBRARY_PATH or -Djava.library.path set. This seems to be because JDK actually looks for libasyncProfiler.dylib, but the Mac OS bundle -- at least 1.8.2 -- calls it libasyncProfiler.so!

I think profiler.sh is unaffected by this, because it points to explicit name: -agentpath:../build/libasyncProfiler.so. This gives us the JMH workaround: -prof async:libPath=../build/libasyncProfiler.so, but it would be more convenient for everything to work without extra options.

Most helpful comment

Maybe not change it for 1.x, but ship the symlink .dylib -> .so?

All 4 comments

Thank you for the report.
Indeed, async-profiler library has the same name on Linux and macOS, whereas the OS naming convention is different.
I think renaming it now in 1.x is not a good idea, since users may rely on the existing name (well, I know actual cases when they do). But this is definitely something I will consider for version 2.0.

Maybe not change it for 1.x, but ship the symlink .dylib -> .so?

Sounds like a solution. Will do.

The fix went into release 1.8.3

Was this page helpful?
0 / 5 - 0 ratings

Related issues

apangin picture apangin  路  5Comments

ceeaspb picture ceeaspb  路  5Comments

franz1981 picture franz1981  路  4Comments

franz1981 picture franz1981  路  8Comments

henryjcee picture henryjcee  路  5Comments