JDK-4951475 : JDWP: Set command with invalid event caused VM to terminate
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 5.0
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2003-11-10
  • Updated: 2003-12-19
  • Resolved: 2003-12-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 b32Fixed
Related Reports
Relates :  
Description
The Set command in the EventRequest command set is specified to return an
error reply with an error of INVALID_EVENT_TYPE when a Set command is
received for an invalid event. Our JDWP agent doesn't do this and instead 
exits with an error in "jdwpEvent to EventIndex".

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b32 tiger-beta
14-06-2004

SUGGESTED FIX ------- EventRequestImpl.c ------- *** /tmp/sccs.5WaG1s Mon Nov 10 15:07:21 2003 --- EventRequestImpl.c Mon Nov 10 15:07:11 2003 *************** *** 207,212 **** --- 207,213 ---- jdwpEvent eventType; jbyte suspendPolicy; jint filterCount; + EventIndex ei; eventType = inStream_readByte(in); if (inStream_error(in)) { *************** *** 221,231 **** return JNI_TRUE; } ! if (eventType == 0) { outStream_setError(out, JDWP_ERROR(INVALID_EVENT_TYPE)); return JNI_TRUE; } ! node = eventHandler_alloc(filterCount, jdwp2EventIndex(eventType), suspendPolicy); if (node == NULL) { outStream_setError(out, JDWP_ERROR(OUT_OF_MEMORY)); return JNI_TRUE; --- 222,233 ---- return JNI_TRUE; } ! ei = jdwp2EventIndex(eventType); ! if (ei == 0) { outStream_setError(out, JDWP_ERROR(INVALID_EVENT_TYPE)); return JNI_TRUE; } ! node = eventHandler_alloc(filterCount, ei, suspendPolicy); if (node == NULL) { outStream_setError(out, JDWP_ERROR(OUT_OF_MEMORY)); return JNI_TRUE; *************** *** 258,263 **** --- 260,266 ---- jvmtiError error; jdwpEvent eventType; HandlerID handlerID; + EventIndex ei; eventType = inStream_readByte(in); if (inStream_error(in)) { *************** *** 268,279 **** return JNI_TRUE; } ! if (eventType == 0) { outStream_setError(out, JDWP_ERROR(INVALID_EVENT_TYPE)); return JNI_TRUE; } ! error = eventHandler_freeByID(jdwp2EventIndex(eventType), handlerID); if (error != JVMTI_ERROR_NONE) { outStream_setError(out, map2jdwpError(error)); } --- 271,284 ---- return JNI_TRUE; } ! ei = jdwp2EventIndex(eventType); ! if (ei == 0) { ! /* NOTE: Clear command not yet spec'ed to return INVALID_EVENT_TYPE */ outStream_setError(out, JDWP_ERROR(INVALID_EVENT_TYPE)); return JNI_TRUE; } ! error = eventHandler_freeByID(ei, handlerID); if (error != JVMTI_ERROR_NONE) { outStream_setError(out, map2jdwpError(error)); } ------- util.c ------- *** /tmp/sccs.iTayGs Mon Nov 10 15:05:42 2003 --- util.c Mon Nov 10 15:04:03 2003 *************** *** 1885,1893 **** return EI_VM_INIT; case JDWP_EVENT(VM_DEATH): return EI_VM_DEATH; - default: - EXIT_ERROR(JVMTI_ERROR_INVALID_EVENT_TYPE,"jdwpEvent to EventIndex"); - break; } return (EventIndex)0; } --- 1885,1890 ----
11-06-2004

EVALUATION As per description - as this issue came up in the context of the JDWP TCK it should be address for beta1. ###@###.### 2003-11-12
12-11-2003