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

[ERROR] Could not set pthread hook #838

Closed
Apeksh742 opened this issue Nov 8, 2023 · 5 comments
Closed

[ERROR] Could not set pthread hook #838

Apeksh742 opened this issue Nov 8, 2023 · 5 comments

Comments

@Apeksh742
Copy link

Hi team,

I am receiving this error [ERROR] Could not set pthread hook when trying to use async profiler on a container.

I have also given SYS_ADMIN capability to the container and is hosted on an ec2 instance. I tried to use the async profiler from the host too but receiving the same error. Any help would be appreciated.

Thanks

@apangin
Copy link
Collaborator

apangin commented Nov 8, 2023

What are OS, JDK and Profiler versions?

@Apeksh742
Copy link
Author

  1. Os - Linux x86_64
  2. java specs:
openjdk 11.0.20.1 2023-08-24
OpenJDK Runtime Environment Temurin-11.0.20.1+1 (build 11.0.20.1+1)
OpenJDK 64-Bit Server VM Temurin-11.0.20.1+1 (build 11.0.20.1+1, mixed mode)
  1. profiler version: async-profiler-2.9-linux-x64

@apangin
Copy link
Collaborator

apangin commented Nov 9, 2023

Does container run Alpine Linux? Which version?

Please try the newest early access version from master, which has the issue likely fixed:

@Apeksh742
Copy link
Author

Apeksh742 commented Nov 9, 2023

Thanks https://profiler.tools/builds/async-profiler-3.0-ea-linux-x64.tar.gz worked for me.
I have one more query when I use this the console shows me warning of

[WARN] Kernel symbols are unavailable due to restrictions. Try
sysctl kernel.kptr_restrict=0
sysctl kernel.perf_event_paranoid=1

I have used these commands also but getting the same warning again & again. So what impact does it have and how to get rid of it?

@apangin
Copy link
Collaborator

apangin commented Nov 20, 2023

@Apeksh742 "Kernel symbols are unavailable" message means the operating system configuration does not allow an unprivileged application to obtain kernel stack traces. In this case, profiler works absolutely fine, except that it does not show where exactly CPU time is spent inside system calls. If you don't need this level of details, you can completely ignore the above warning.

If you want async-profiler to collect kernel stack traces, run the following commands on the host (not inside a container) under a privileged user (root):

sysctl kernel.kptr_restrict=0
sysctl kernel.perf_event_paranoid=1

Otherwise, if you are fine with user-mode stacks only, add --all-user option to suppress the warning.

@apangin apangin closed this as completed Nov 20, 2023
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

2 participants