Comments (13)
@roy-20230331 libasyncProfiler.so
should be available in the container at the same path as in the host. Please see the linked questions for details.
from async-profiler.
Please, remove > /dev/null
at profiler.sh:48 and rerun the script to see if jattach prints an error message.
from async-profiler.
Well.. I did that, retried, and the attach worked just fine. Tried adding > /dev/null
back, for sanity, but it seems to work now. I'm not entirely sure what I changed. I'll come back with updated output if I'm able to reproduce it again.
from async-profiler.
I've got the same issue
After removing all >/dev/null
s the output is:
Connected to remote JVM
Response code = -1
Failed to inject profiler into 32698
linux-vdso.so.1 => (0x00007fffa0d2d000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f27e9042000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f27e8e26000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f27e8b1f000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f27e889d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f27e8687000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f27e82fa000)
/lib64/ld-linux-x86-64.so.2 (0x00007f27e98e5000)
Couldn't find any solution out there.
@apangin , please advise
from async-profiler.
@krems Are you building async-profiler from master
without changes?
Please check what the following command prints.
java -agentpath:/path/to/libasyncProfiler.so=start,summary,flat -version
from async-profiler.
Yes
$ java -agentpath:./build/libasyncProfiler.so=start,summary,flat -version
Started [cpu] profiling
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
--- Execution profile ---
Total samples: 10
Unknown (native): 3 (30.00%)
Frame buffer usage: 0.0079%
2091384 (20.60%) 2 Method::make_jmethod_id(ClassLoaderData*, Method*)
1136257 (11.19%) 1 java.io.BufferedWriter.write
1015855 (10.00%) 1 java.lang.Thread.<init>
1012302 ( 9.97%) 1 java.util.LinkedHashMap.linkNodeLast
1007078 ( 9.92%) 1 ClassFileParser::parseClassFile(Symbol*, ClassLoaderData*, Handle, KlassHandle, GrowableArray<Handle>*, TempNewSymbol&, bool, Thread*)
1006586 ( 9.91%) 1 SignatureStream::SignatureStream(Symbol*, bool)
998909 ( 9.84%) 1 SymbolTable::lookup_only(char const*, int, unsigned int&)
995460 ( 9.80%) 1 clock_gettime
from async-profiler.
I should mention that I have to run profiler via sudo -u user ./profiler.sh
from async-profiler.
OK, the library seems to work.
Is anything printed in stderr
of the target JVM when you run profiler.sh
?
from async-profiler.
No output, but I found out what was the problem.
I'd assume this is our administration settings issue.
Even though I was running profiler.sh
under user, the fact that async-profiler/*
files were not in that user's home dir prevented profiler from attaching to the JVM process.
Moving async-profiler
dir to user's home fixed the problem
from async-profiler.
I hit a similar error when I tried to attach the async profiler to something that was running inside a LXC container. Running it from inside the container did the trick for me.
from async-profiler.
Thank you for the details. The clue is that profiler library is loaded by the target JVM on behalf of the user of the JVM process. This implies that async-profiler binary must be accessible by that user by exactly the same absolute path. I'll update troubleshooting sections with this information.
from async-profiler.
Dear @apangin,
I encounter this issue when I run async profiler in host, my application is running as container in this host.
[root@ip-1-1-1-1 async-profiler-2.9-linux-x64]# java -agentpath:/tmp/async-profiler-2.9-linux-x64/build/libasyncProfiler.so=start,flat -version
Profiling started
openjdk version "11.0.18" 2023-01-17 LTS
OpenJDK Runtime Environment Corretto-11.0.18.10.1 (build 11.0.18+10-LTS)
OpenJDK 64-Bit Server VM Corretto-11.0.18.10.1 (build 11.0.18+10-LTS, mixed mode)
Execution profile
Total samples : 0
ns percent samples top
[root@ip-1-1-1-1 async-profiler-2.9-linux-x64]# ./profiler.sh -d 30 -e mprotect -f /tmp/a.html 13751
Failed to inject profiler into 13751
./profiler.sh: line 116: /bin/true: No such file or directory
[root@ip-1-1-1-1 async-profiler-2.9-linux-x64]# ./profiler.sh -v
Async-profiler 2.9 built on Nov 26 2022
Copyright 2016-2021 Andrei Pangin
[oot@ip-1-1-1-1 async-profiler-2.9-linux-x64]#
I give all the permission(-rwxrwxrwx) to libasyncProfiler.so.
[root@ip-1-1-1-1 build]# ll
total 460
-rwxrwxrwx 1 root root 5015 Nov 26 22:40 async-profiler.jar
-rwxrwxrwx 1 root root 46172 Nov 26 22:40 converter.jar
-rwxrwxrwx 1 root root 18218 Nov 26 22:40 fdtransfer
-rwxrwxrwx 1 root root 24850 Nov 26 22:40 jattach
-rwxrwxrwx 1 root root 361312 Nov 26 22:40 libasyncProfiler.so
[root@ip-1-1-1-1 build]#
Could u please kindly help to check?
from async-profiler.
I see, thx @apangin !
from async-profiler.
Related Issues (20)
- Native errors when running async-profiler with JNI library HOT 2
- Segmentation fault on Azul Zing HOT 10
- `Unexpected EOF reading response` when running `asprof stop` after multiple collections HOT 2
- How to Enable Profiling in Kubernetes Pods? HOT 2
- Attach process is crash when asprof HOT 3
- Could not find agent library /mnt/libasyncProfiler.so in absolute path libstdc++.so.6: cannot open shared object file: No such file or directory HOT 7
- Cannot use BPF with asprof HOT 11
- Why'live' option is only supported on OpenJDK 11+, why JDK8 is not supported, is it a JDK limitation or async-profiler implementation limitation? HOT 1
- Converter with jfr2heat in main branch? HOT 2
- Fix broken JFR is possible? HOT 5
- No output from AP 3.0 HOT 10
- Solve musl and glibc compatibility issues
- Profiling page faults with cstack results in one-deep stack information HOT 3
- asprof list jps is empty HOT 4
- Add an asprof argument to specify the path of libasyncProfier.so in the container HOT 1
- `jfr2flame` can't properly filter thread states with `jfrsync` enabled. HOT 2
- "Profiler started" doesn't honor loglevel HOT 1
- JDK 24-ea crashing HOT 2
- statement level profiling HOT 3
- large of GC_active in the flamegraph HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-profiler.