Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used the same libasyncProfiler.so to profile event alloc twice in different the path,the second time failed with “[ERROR] Could not set dlopen hook” #701

Open
zangcq opened this issue Dec 21, 2022 · 2 comments

Comments

@zangcq
Copy link

zangcq commented Dec 21, 2022

Hi Team;
env:

  • OS is Debian 9
  • java -version is openjdk 1.8.0_352
  • async-profiler is latest v2.9

when we used the same libasyncProfiler.so to profile event alloc twice in defferent path

  1. at first command ./profiler.sh -d 5 -e alloc 2735959 everything would be ok,and the process has loaded the libasyncProfiler.so correctly。
  2. i remove the original libasyncProfiler.so ,and build it in another directory.
  3. at second time command ./profiler.sh -d 5 -e alloc 2735959 failed with “[ERROR] Could not set dlopen hook”
Connected to remote JVM
JVM response code = 0
200

[ERROR] Could not set dlopen hook. Unsupported JVM?
  1. cat /proc/PID/smaps | grep libasyncProfiler.so
7fbeb6414000-7fbeb645b000 r-xp 00000000 08:10 4072470                    /2/async_profiler/build/libasyncProfiler.so
7fbeb645b000-7fbeb665b000 ---p 00047000 08:10 4072470                    /2/async_profiler/build/libasyncProfiler.so
7fbeb665b000-7fbeb665c000 r--p 00047000 08:10 4072470                    /2/async_profiler/build/libasyncProfiler.so
7fbeb665c000-7fbeb665d000 rw-p 00048000 08:10 4072470                   /2/async_profiler/build/libasyncProfiler.so
7fbeba819000-7fbeba860000 r-xp 00000000 08:10 4072254                    /1/as/build/libasyncProfiler.so (deleted)
7fbeba860000-7fbebaa60000 ---p 00047000 08:10 4072254                    /1/as/build/libasyncProfiler.so (deleted)
7fbebaa60000-7fbebaa61000 r--p 00047000 08:10 4072254                    /1/as/build/libasyncProfiler.so (deleted)
7fbebaa61000-7fbebaa62000 rw-p 00048000 08:10 4072254                    /1/as/build/libasyncProfiler.so (deleted)
@zangcq zangcq changed the title Used the same libasyncProfiler.so to profile event alloc twice,the second time failed with “[ERROR] Could not set dlopen hook” Used the same libasyncProfiler.so to profile event alloc twice in different the path,the second time failed with “[ERROR] Could not set dlopen hook” Dec 21, 2022
@apangin
Copy link
Collaborator

apangin commented Dec 21, 2022

Currently async-profiler cannot be loaded twice from different locations.

@clxsh
Copy link

clxsh commented Dec 22, 2022

Currently async-profiler cannot be loaded twice from different locations.

Hi Andrei,

I reproduced the problem.

Actually, I could profile cpu event from different locations, it works properly, and the process loaded libasyncProfiler.so more than twice.

But for alloc event, it indeed can't. Is there any difference between them

cat /proc/[pid]/maps | grep async

7fe259715000-7fe259757000 r-xp 00000000 08:01 1966946                    /tmp/async_profiler4/build/libasyncProfiler.so
7fe259757000-7fe259957000 ---p 00042000 08:01 1966946                    /tmp/async_profiler4/build/libasyncProfiler.so
7fe259957000-7fe259959000 rw-p 00042000 08:01 1966946                    /tmp/async_profiler4/build/libasyncProfiler.so
7fe25e664000-7fe25e6a6000 r-xp 00000000 08:01 1969578                    /tmp/async_profiler3/build/libasyncProfiler.so
7fe25e6a6000-7fe25e8a6000 ---p 00042000 08:01 1969578                    /tmp/async_profiler3/build/libasyncProfiler.so
7fe25e8a6000-7fe25e8a8000 rw-p 00042000 08:01 1969578                    /tmp/async_profiler3/build/libasyncProfiler.so
7fe2635b3000-7fe2635f5000 r-xp 00000000 08:01 1969133                    /tmp/async_profiler2/build/libasyncProfiler.so
7fe2635f5000-7fe2637f5000 ---p 00042000 08:01 1969133                    /tmp/async_profiler2/build/libasyncProfiler.so
7fe2637f5000-7fe2637f7000 rw-p 00042000 08:01 1969133                    /tmp/async_profiler2/build/libasyncProfiler.so
7fe284b9c000-7fe284bde000 r-xp 00000000 08:01 1966823                    /tmp/async_profiler1/build/libasyncProfiler.so
7fe284bde000-7fe284dde000 ---p 00042000 08:01 1966823                    /tmp/async_profiler1/build/libasyncProfiler.so
7fe284dde000-7fe284de0000 rw-p 00042000 08:01 1966823                    /tmp/async_profiler1/build/libasyncProfiler.so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants