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

Get the process' running GID in addition to UID #236

Merged
merged 1 commit into from
Jul 29, 2020

Conversation

patcable
Copy link
Contributor

@patcable patcable commented Jun 1, 2020

On machines where the Java process' primary GID may not match the running GID it's possible to run into issues - specifically:

Exception in thread "main" java.io.IOException: well-known file /tmp/.java_pid22933 is not secure: file's group should be the current group (which is 9999) but the group is 999
	at sun.tools.attach.LinuxVirtualMachine.checkPermissions(Native Method)
	at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:117)
	at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
	at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
	at net.virtualvoid.perf.AttachOnce.loadAgent(AttachOnce.java:38)
	at net.virtualvoid.perf.AttachOnce.main(AttachOnce.java:34)

Reading the process' running group and using that as a sudo parameter avoids that error. May want to test on a system that doesn't output names (happy to do this - just need a pointer).

@brendangregg
Copy link
Owner

ok, thanks!

@brendangregg brendangregg merged commit a258e78 into brendangregg:master Jul 29, 2020
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

Successfully merging this pull request may close these issues.

2 participants