-
Enhancement
-
Resolution: Fixed
-
P4
-
9
-
b19
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8063460 | 8u45 | Staffan Larsen | P4 | Resolved | Fixed | b01 |
JDK-8056173 | 8u40 | Staffan Larsen | P4 | Resolved | Fixed | b06 |
JDK-8071007 | emb-8u47 | Staffan Larsen | P4 | Resolved | Fixed | team |
The code in attachListener.cpp does this:
DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);
if (HAS_PENDING_EXCEPTION) {
java_lang_Throwable::print(PENDING_EXCEPTION, out);
out->cr();
CLEAR_PENDING_EXCEPTION;
// The exception has been printed on the output stream
// If the JVM returns JNI_ERR, the attachAPI throws a generic I/O
// exception and the content of the output stream is not processed.
// By returning JNI_OK, the exception will be displayed on the client side
}
return JNI_OK;
That was correct before the fix ofJDK-8039173. After that fix, the attach framework is able to propagate error messages when an attach command fails.
The code in attachListener.cpp should be updated to:
DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);
if (HAS_PENDING_EXCEPTION) {
java_lang_Throwable::print(PENDING_EXCEPTION, out);
out->cr();
CLEAR_PENDING_EXCEPTION;
return JNI_ERR;
}
return JNI_OK;
DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);
if (HAS_PENDING_EXCEPTION) {
java_lang_Throwable::print(PENDING_EXCEPTION, out);
out->cr();
CLEAR_PENDING_EXCEPTION;
// The exception has been printed on the output stream
// If the JVM returns JNI_ERR, the attachAPI throws a generic I/O
// exception and the content of the output stream is not processed.
// By returning JNI_OK, the exception will be displayed on the client side
}
return JNI_OK;
That was correct before the fix of
The code in attachListener.cpp should be updated to:
DCmd::parse_and_execute(DCmd_Source_AttachAPI, out, op->arg(0), ' ', THREAD);
if (HAS_PENDING_EXCEPTION) {
java_lang_Throwable::print(PENDING_EXCEPTION, out);
out->cr();
CLEAR_PENDING_EXCEPTION;
return JNI_ERR;
}
return JNI_OK;
- backported by
-
JDK-8056173 Attach code should propagate errors in Diagnostic Commands as errors
-
- Resolved
-
-
JDK-8063460 Attach code should propagate errors in Diagnostic Commands as errors
-
- Resolved
-
-
JDK-8071007 Attach code should propagate errors in Diagnostic Commands as errors
-
- Resolved
-
- relates to
-
JDK-8039173 Propagate errors from Diagnostic Commands as exceptions in the attach framework
-
- Resolved
-