Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6d05a4d

Browse files
author
jyoung
committedApr 18, 2020
Add -Xverify:none to tests and docs
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
1 parent 540cd9c commit 6d05a4d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed
 

‎pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<exclude>**/TransformerTest.java</exclude>
5656
</excludes>
5757
<argLine>
58-
-javaagent:"${project.build.directory}/file-leak-detector-${project.version}-jar-with-dependencies.jar"
58+
-javaagent:"${project.build.directory}/file-leak-detector-${project.version}-jar-with-dependencies.jar" -Xverify:none
5959
</argLine>
6060
</configuration>
6161
</execution>

‎src/site/apt/index.apt

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,34 @@ What is this?
1414
dependency jar and the list of the table can be
1515
{{{http://file-leak-detector.kohsuke.org/apidocs/index.html?org/kohsuke/file_leak_detector/Listener.html}programmatically accessed}}.
1616

17+
Warning
18+
19+
The agent modifies the bytecode of core java classes, which causes java bytecode
20+
validation to fail ({{{https://www.ibm.com/support/pages/ibm-java-linux-howto-resolving-javalangverifyerror-jvmvrfy012-stack-shape-inconsistent}details}}). For it to work in newer version
21+
of java you need the include the -Xverify:none flag when running the javaagent.
22+
1723
Usage
1824

1925
Without any option, this tool silently records file open/close operations
2026
and upon "too many open files" exception, the table will be dumped to
2127
stderr.
2228

2329
-------------
24-
$ java -javaagent:path/to/file-leak-detector.jar ...your usual Java args follows...
30+
$ java -javaagent:path/to/file-leak-detector.jar -Xverify:none ...your usual Java args follows...
2531
-------------
2632

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

3036
-------------
31-
$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 ...your usual Java args follows...
37+
$ java -javaagent:path/to/file-leak-detector.jar=threshold=200 -Xverify:none ...your usual Java args follows...
3238
-------------
3339

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

3743
-------------
38-
$ java -javaagent:path/to/file-leak-detector.jar=http=19999 ...your usual Java args follows...
44+
$ java -javaagent:path/to/file-leak-detector.jar=http=19999 -Xverify:none ...your usual Java args follows...
3945
-------------
4046

4147
Use the help option to see the help screen for the complete list of options.
@@ -52,5 +58,5 @@ Attaching after VM startup
5258
in the same format you do to the agent.
5359

5460
-------------
55-
$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong
61+
$ java -jar path/to/file-leak-detector.jar 1500 threshold=200,strong -Xverify:none
5662
-------------

0 commit comments

Comments
 (0)
Please sign in to comment.