JDK-6263814 : Regression: jdwp onthrow options seems to be ignored
  • Type: Bug
  • Component: core-svc
  • Sub-Component: debugger
  • Affected Version: 5.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-04-29
  • Updated: 2010-04-02
  • Resolved: 2005-06-02
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 JDK 6
5.0u5Fixed 6 b39Fixed
Description
FULL PRODUCT VERSION :
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
When I run the code below with the command

java -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,onthrow=org.xml.sax.SAXException,launch=notepad.exe,suspend=y test3

the vm does not launch with notepad.

However with JDK 1.4 the vm does launch notepad.

Note that the same failure happens when the 'new' agentlib flag is used
instead of the old Xdebug/Xrunjdwp.







STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Compile attached code and run with aformentioned command line
on Windows.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The VM should launch notepad.
ACTUAL -
The VM does not launch notepad

ERROR MESSAGES/STACK TRACES THAT OCCUR :
There are no error messages

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
public class test3 extends Thread {
  static void doThrow() throws org.xml.sax.SAXException {
    throw new org.xml.sax.SAXException( "" );
  }
  public static void main( final String[] args )  throws Throwable {
    System.out.println( "start" );
    doThrow();
  }
}


---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
There is no workaround
###@###.### 2005-04-29 22:19:00 GMT

Comments
SUGGESTED FIX ######### sccs diffs debugInit.c ------- debugInit.c ------- 456,458c456,459 < < error = methodClass(method, &clazz); < if ( error == JVMTI_ERROR_NONE ) { --- > > /* Get class of exception thrown */ > clazz = JNI_FUNC_PTR(env,GetObjectClass)(env, exception); > if ( clazz != NULL ) { 461a463,464 > LOG_MISC(("Checking specific exception: looking for %s, got %s", > initOnException, signature)); 469a473,474 > } else { > error = AGENT_ERROR_INTERNAL; /* Just to cause restore */ ###@###.### 2005-05-16 17:00:54 GMT
16-05-2005

EVALUATION It appears that the onthrow option is broken. It's using the class name of the method doing the throw rather than the classname of the exception being thrown. Not sure how this managed to get by all the testing. ###@###.### 2005-05-16 17:00:54 GMT
16-05-2005