As JNI ExceptionOccured(env) returns a jthrowable reference that should be freed by DeleteLocalRef(jthrowable), it should not be used to test if an exception is pending but use JNI ExceptionCheck(env) instead that returns a boolean.
I used JetBrains CLion to quickly check all OpenJDK src/ folder using the pattern 'if.*ExceptionOccurred' and found 235 invalid cases.
As this problem is low level (leak) and very wide-spread, I cannot deal with such a large patch myself.
I used JetBrains CLion to quickly check all OpenJDK src/ folder using the pattern 'if.*ExceptionOccurred' and found 235 invalid cases.
As this problem is low level (leak) and very wide-spread, I cannot deal with such a large patch myself.
1.
|
Fix ExceptionOccurred in hotspot | Resolved | Justin Lu | ||
2.
|
Fix ExceptionOccurred in java.base | Resolved | Justin Lu | ||
3.
|
Fix ExceptionOccurred in java.desktop | Resolved | Laurent Bourgès | ||
4.
|
Fix ExceptionOccurred in java.prefs | Resolved | Justin Lu | ||
5.
|
Fix ExceptionOccurred in java.security.jgss | Resolved | Weijun Wang | ||
6.
|
Fix ExceptionOccurred in jdk.accessibility | Resolved | Laurent Bourgès | ||
7.
|
Fix ExceptionOccurred in jdk.attach | Resolved | Justin Lu | ||
8.
|
Fix ExceptionOccurred in jdk.crypto.cryptoki | Closed | Unassigned | ||
9.
|
Fix ExceptionOccurred in jdk.hotspot.agent | Resolved | Justin Lu | ||
10.
|
Fix ExceptionOccurred in jdk.jdi | Resolved | Justin Lu | ||
11.
|
Fix ExceptionOccurred in jdk.jdwp.agent | Resolved | Justin Lu | ||
12.
|
Update ExceptionOccurred description in the JNI documentation | Resolved | David Holmes | ||
13.
|
Fix leftover ExceptionOccurred in java.base | In Progress | Justin Lu |