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

Improve diagnostics/troubleshooting features for agent installation #1602

Open
sbailliez opened this issue Feb 27, 2024 · 1 comment
Open
Assignees
Milestone

Comments

@sbailliez
Copy link

It might be useful to have some better diagnostic features to help troubleshoot the agent misbehaving during the attachment process.

  • Document the property net.bytebuddy.agent.attacher.dump and if the agent fails, provide some recommendations to use it if it is not enabled already.
  • Log the command line created by ByteBuddyAgent to attach to the vm in the log dump file. Right now it is opaque and you have to debug to know what process command line gets executed
  • Provide the ability to pass extra jvm arguments to the command line to help debugging/troubleshooting (probably some security elements to consider here)
  • Capture the output of the process and report in the dump file in case of failure

Additional idea to consider, when debugging an agent issue with mockito, I found that the openjdk jvm checks that the .attach_pid<pid> file created has the same uid that the current user and does not attach if they are different, it would be nice to provide a check to help guide the user when such case is detected and make this part of bytebuddy. See mockito/mockito#2436 (comment) for more details.

@raphw
Copy link
Owner

raphw commented Mar 5, 2024

I agree with (1) and already added the property to the exception. (4) should come implicit with that as Byte Buddy controls the output within the Attacher main method. I do however not want to offer (2) and (3) for security reasons, this can be debugged differently, I think. When knowing the code, a user can explicitly log the passed statements in a more secure manner, for example. byte-buddy-agent is small enough so that everybody should be able to click through.

@raphw raphw self-assigned this Mar 5, 2024
@raphw raphw added this to the 1.14.12 milestone Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants