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

OpenJ9 Attach API Diagnostic extension #2543 #2621

Closed
wants to merge 1 commit into from

Conversation

d0k1
Copy link

@d0k1 d0k1 commented Aug 15, 2018

To implement command line diagnostic utilities like jstack / jmap / etc I decided to use Attact API just as jstack does. Attach API extension contains 8 new commands. Among them, there are commands to get javadump/systemdump/heapdump/snapdump and to get Information about memory, about loaded/unloaded classes about JIT compilation time. There is one command to get a thread dump through com.ibm.lang.management.internal.ExtendedThreadMXBeanImpl. The communication between JVM and Attach API client is going through IPC mechanism. Some commands have to send back some data to a client so they use java serialization to serialize a response and send it. Besides there are some new methods in com.ibm.tools.attach.attacher.OpenJ9VirtualMachine that uses the extension. #2543

Fixes #2543

Signed-off-by: Denis Kirpichenkov denis.kirpichenkov@gmail.com

@DanHeidinga
Copy link
Member

Thanks for opening this PR, @d0k1!

Have you signed the Eclipse Contributor Agreement? As an Eclipse project, all contributors need to sign the ECA and have their commits pass the ip-validation check by using signed commits (ie: git commit -s)

Can you confirm you've signed the ECA and update the commit message to include the correct Signed-off by: tag?

Also, is there an existing issue that describes the approach taken to adding these extensions? If there is, can you link to it from this item? Any additional description of the design will help when reviewing the PR.

Thanks again!

@d0k1 d0k1 force-pushed the master branch 3 times, most recently from 3c3726c to 99cb580 Compare August 19, 2018 13:36
@DanHeidinga
Copy link
Member

@pdbain-ibm Can you take a look at the highlevel approach taken here and comment on how well it integrates into the existing attach api code?

@pdbain-ibm
Copy link
Contributor

Dan

Will do.

@d0k1 As you can appreciate, security is an issue with the JVM and particularly attachAPI. Would you kindly indicate what steps you have taken to avoid compromising security. Thank you.

@DanHeidinga
Copy link
Member

Please create a new class which extends OpenJ9VirtualMachine and move the new methods to same.

@pdbain-ibm What benefit does this bring?

@pdbain-ibm
Copy link
Contributor

a) it keeps the OpenJ9VirtualMachine API congruent with the com.sun implementation, which has been a design goal from the start of the attach API project.
b) it separates the core attach API methods from the extensions thereto.

API Extension to implement command line diagnostic utilities like jstack / jmap / etc  eclipse-openj9#2543

Fixes eclipse-openj9#2543

Signed-off-by: Denis Kirpichenkov <denis.kirpichenkov@gmail.com>
@d0k1
Copy link
Author

d0k1 commented Sep 10, 2018

@pdbain-ibm You asked about steps I took to avoid compromising security. Honestly, I did nothing. This PR is just a prototype of extended Attach API.
I would glad to hear advice about security check I need to implement.
May be I should do the same security check as Dump class (jcl/src/openj9.jvm/share/classes/com/ibm/jvm/Dump.java) does in it's methods? May be I should check if current user that tries to make a dump is the same who started a JVM?

@AdamBrousseau
Copy link
Contributor

Jenkins line endings check

@d0k1 d0k1 closed this Sep 27, 2018
@pshipton
Copy link
Member

@d0k1 why close this pull request? Have you decided not to pursue this?

@d0k1
Copy link
Author

d0k1 commented Sep 28, 2018

@pshipton Unfortunately adaptation of OpenJ9 has been stopped in project I'm involved in. I had no time to continue working on this issue, so I decided to close this pull request to keep repository clean of this unfinished work

@pshipton
Copy link
Member

@d0k1 if you are able to share any details of why you decided to stop using OpenJ9, can you please let me know, either here or by direct email. I'm wondering if there are any specific areas we should be focusing on to improve OpenJ9.

@thjaeckle
Copy link

Very sad to not have that included in OpenJ9 - we would need to use the same (e.g. using jmap in order to get a heapdump from a running JVM).

@DanHeidinga
Copy link
Member

@d0k1 Thanks for creating this pull request.

If you have no objections, we'd like to reopen this PR with goal of getting it merged. If you're interested in helping with that, great! If not, we'll take on the work required to get this through reviews and into OpenJ9.

@pdbain-ibm
Copy link
Contributor

This will also need test cases.

@SueChaplain
Copy link
Contributor

@pdbain-ibm - does this require any user documentation please? If so, please add the doc:externals label and open an issue at the docs repo: https://github.com/eclipse/openj9-docs/issues/new?template=new-documentation-change.md

@pshipton
Copy link
Member

Not sure we'll be merging this particular PR as-is, but I've added a depends:doc tag for tracking anyway.

@d0k1
Copy link
Author

d0k1 commented Feb 2, 2019

@DanHeidinga Thanks for interest in this PR. Of course you can use it freely, I have no objections at all.
I'm just curios what about some concerns @pdbain-ibm had written about?
I'd like to add that, this API extension is just an extension, and OpenJ9 at the moment is still missing utilities that would use it. Is there any plans to implements such utilities?

I'd say that it's great to continue working on this PR, but I don't know where to start at the moment.

@DanHeidinga
Copy link
Member

Thanks @d0k1. Re: @pdbain-ibm's concerns, they can be handled in review - validating that appropriate security concerns have been identified and mitigated.

@pshipton
Copy link
Member

pshipton commented Feb 7, 2019

As this is being implemented by other PRs, closing this one.

@pshipton pshipton closed this Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants