jenkinsci / lib-file-leak-detector

Java agent that detects file handle leak
http://file-leak-detector.kohsuke.org/
MIT License
241 stars 112 forks source link

Add `-Xverify:none` to docs for OpenJ9 #50

Closed mandragorn closed 1 year ago

mandragorn commented 4 years ago

This PR tries to address issue #37.

On newer versions of java bytecode is verified before it is run. Since this agent modifies core java bytecode it needs to bypass this verification. To turn the verification off pass -Xverify:none as an argument when running the agent. Fixed in unit tests and docs.

Details: https://www.ibm.com/support/pages/ibm-java-linux-howto-resolving-javalangverifyerror-jvmvrfy012-stack-shape-inconsistent

MarkEWaite commented 1 year ago

@mandragorn is this specific to the Eclipse J9 virtual machine? The Jenkins platform SIG stopped efforts to support Eclipse J9 in 2021 because we did not have people with enough time to test it.

If it is not specific to J9, are you still interested in this pull request and willing to resolve the conflicts?

mandragorn commented 1 year ago

Wow this is from a lifetime ago, I don't remember the details and I don't have whatever env I used to generate the issue (this was before I switched jobs).

Based on the linked issue #37 and my comment there, it looks like I was testing this with the openjdk jvm, but I don't remember any details beyond that.

I'm happy to rebase and push the update if you'd like me to.

mandragorn commented 1 year ago

conflicts resolved.

mandragorn commented 1 year ago

Docs updated.

mandragorn commented 1 year ago

Note that I think the bytecode generation that happens means that this doesn't work on any version of java beyond java 8 w/o -Xverify:none. BUT I don't currently have the time or setup to test this to verify that assumption. I do not think it is specific to OpenJ9, but again that is an assumption that I haven't tested.

If anyone has a way to test and confirm or deny those assumptions, let me know and I can update the docs as part of this commit.

mandragorn commented 1 year ago

Thank you @basil for the feedback!