You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Ivan Popov (JIRA)" <ji...@apache.org> on 2007/04/18 15:53:15 UTC

[jira] Created: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

[drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
-----------------------------------------------------------------------------------

                 Key: HARMONY-3698
                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM, JDK
         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
            Reporter: Ivan Popov


JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.

Here is test class to reproduce this problem.

public class TestClass {
	public static void main(String[] args) {
		try {
			throw new TestException("test");  // exception breakpoint line
		} catch (TestException e ){
			e.printStackTrace();
		}
	}

	static public class TestException extends RuntimeException {
		TestException(String msg) {
			super(msg);
		}
	}
}

To reproduce:
1. Load this class to Eclipse
2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
3. Launch this class under debugger (Run->Debug)
4. Wait until application is suspended on exception throw

Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Popov updated HARMONY-3698:
--------------------------------

    Attachment: jdwp_test.patch

Attached patch "jdwp_test.patch" adds additional test case to JDWP test

  org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest

to reproduce this problem.

To run this test apply patch to jdktools component, build Harmony JDK with federated build, and run the test:

1. goto jdktools directory, add junit to classpath, and run particular test:
    cd working_jdktools
    export CLASSPATH=<...>/trunk/common_resources/depends/jars/junit_3.8.2/junit.jar
    ant test -Dbuild.module=jpda -Dtest.case=org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest

2. see results in <...>/trunk/working_jdktools/build/test_report/html/index.html

It is possible also to run test directly from command line:
   cd working_jdktools
   deploy/jdk/bin/java -classpath ../common_resources/depends/jars/junit_3.8.2/junit.jar:build/tests/classes \
   org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest

Typical test output for for this problem is the following:

<...>
>> testExceptionEventLocation: Event is received! Check it ...
>> testExceptionEventLocation: parsedEvents.length = 1
>> testExceptionEventLocation: parsedEvents[0].getEventKind() = 4
>> testExceptionEventLocation: returnedThread = 1828
>> testExceptionEventLocation: returnedExceptionLoc = Location: tag=1, classID=1000000572, methodID=142759272, index=65
>> testExceptionEventLocation: topFrameLoc = Location: tag=1, classID=1000000572, methodID=142759272, index=66
<...>
1) testExceptionEventLocation(org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest)junit.framework.AssertionFailedError: Different exception and top frame location index, expected:<65> but was:<66>
        at org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest.testExceptionEventLocation(ExceptionTest.java:164)
        at java.lang.reflect.VMReflection.invokeMethod(VMReflection.java)
        at org.apache.harmony.jpda.tests.jdwp.Events.ExceptionTest.main(ExceptionTest.java:46)


> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>         Attachments: jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky resolved HARMONY-3698.
----------------------------------------

    Resolution: Fixed

Patch and regression test were applied at 540622. The new test in jdktools was added at 540623. Please check that the bug is fixed now.

I had to exclude regression test for x86_64 architectures because JVMTI doesn't work correctly on this platform yet.

> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>         Assigned To: Gregory Shimansky
>         Attachments: H3698-jvmti-stack-trace-fixed.patch, H3698-Regression-test.patch, jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Ivan Popov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ivan Popov closed HARMONY-3698.
-------------------------------


Verified in harmony-jdk-r542764. Closing this issue.


> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>            Assignee: Gregory Shimansky
>         Attachments: H3698-jvmti-stack-trace-fixed.patch, H3698-Regression-test.patch, jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene S. Ostrovsky updated HARMONY-3698:
-----------------------------------------

    Attachment: H3698-Regression-test.patch

Added file:
  H3698-Regression-test.patch

Simple regression test.

> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>         Attachments: H3698-Regression-test.patch, jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gregory Shimansky reassigned HARMONY-3698:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>         Assigned To: Gregory Shimansky
>         Attachments: H3698-jvmti-stack-trace-fixed.patch, H3698-Regression-test.patch, jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HARMONY-3698) [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame

Posted by "Eugene S. Ostrovsky (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HARMONY-3698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eugene S. Ostrovsky updated HARMONY-3698:
-----------------------------------------

    Attachment: H3698-jvmti-stack-trace-fixed.patch

Added file:
  H3698-jvmti-stack-trace-fixed.patch

This patch fixes jvmti stack trace functions implementation that reported not precise  location info.

> [drlvm][jvmti] location of EXCEPTION event differs from location of top stack frame
> -----------------------------------------------------------------------------------
>
>                 Key: HARMONY-3698
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3698
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM, JDK
>         Environment: Linux/x86, Windows/x86, apache-harmony-jdk-r529895
>            Reporter: Ivan Popov
>         Attachments: H3698-jvmti-stack-trace-fixed.patch, H3698-Regression-test.patch, jdwp_test.patch
>
>
> JVMTI callback for EXCEPTION event reports location for thrown exception different than the location of top stack frame. This lead that Eclipse debugger shows wrong source line when exception application is stopped on exception throw. In RI both locations are equal.
> Here is test class to reproduce this problem.
> public class TestClass {
> 	public static void main(String[] args) {
> 		try {
> 			throw new TestException("test");  // exception breakpoint line
> 		} catch (TestException e ){
> 			e.printStackTrace();
> 		}
> 	}
> 	static public class TestException extends RuntimeException {
> 		TestException(String msg) {
> 			super(msg);
> 		}
> 	}
> }
> To reproduce:
> 1. Load this class to Eclipse
> 2. Set exception breakpoint for TestException class (Run->AddJavaExceptionBreakpoint...)
> 3. Launch this class under debugger (Run->Debug)
> 4. Wait until application is suspended on exception throw
> Eclipse will highlight source line with catch clause instead of throw clause. This is because Eclipse relies on the location of the top stack frame rather than on location of an event. In RI both locations are equal, but in DRLVM locations are different.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.