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 leftover ExceptionOccurred in java.base | In Progress | Justin Lu |