Skip to content

Commit

Permalink
Add -Xverify:none to tests and docs
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jyoung authored and mandragorn committed May 30, 2023
1 parent 3c43ce6 commit 86c20ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ Without any options, this tool silently records file open/close operations and u

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector.jar -Xverify:none ...your usual Java arguments follow...
----

There are several options you can pass to the agent.
For example, to dump the open file descriptors when the total number reaches 200, you can do the following:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 -Xverify:none ...your usual Java arguments follow...
----

Or to have it run a mini HTTP server so that you can access the information from your browser, do the following and open http://localhost:19999/:

[source,sh]
----
$ java -javaagent:path/to/file-leak-detector.jar=http=19999 ...your usual Java arguments follow...
$ java -javaagent:path/to/file-leak-detector.jar=http=19999 -Xverify:none ...your usual Java arguments follow...
----

Use the help option to see the help screen for the complete list of options:
Expand All @@ -57,7 +57,7 @@ Options can be specified in the second argument in the same format you do to the

[source,sh]
----
$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong
$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong -Xverify:none
----

== Supported options
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<exclude>**/TransformerTest.java</exclude>
<exclude>**/AgentMainTest.java</exclude>
</excludes>
<argLine>-javaagent:"${project.build.directory}/file-leak-detector-${project.version}-jar-with-dependencies.jar"</argLine>
<argLine>-javaagent:"${project.build.directory}/file-leak-detector-${project.version}-jar-with-dependencies.jar" -Xverify:none</argLine>
</configuration>
</execution>
<execution>
Expand Down

0 comments on commit 86c20ce

Please sign in to comment.