You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Chris Elford (JIRA)" <ji...@apache.org> on 2006/12/30 00:18:21 UTC

[jira] Created: (HARMONY-2926) JVMTI Exception Callbacks reported at incorrect byte code offset

JVMTI Exception Callbacks reported at incorrect byte code offset
----------------------------------------------------------------

                 Key: HARMONY-2926
                 URL: http://issues.apache.org/jira/browse/HARMONY-2926
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
         Environment: Binary JRE release: harmony-jre-r487452
32bit windows XP SP2
            Reporter: Chris Elford
            Priority: Minor
         Attachments: repro.java

If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.

c:\java\bea50\bin\java -agentlib:bugshow repro
...
EXCEPTION: main(bc=0xf)->main(bc=0x13)
...

c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
...
EXCEPTION: main(bc=0xf)->main(bc=0x13)
...

c:\java\hre50\bin\java -agentlib:bugshow repro
...
EXCEPTION: main(bc=0x10)->main(bc=0x13)
...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky commented on HARMONY-2926:
--------------------------------------------

The bug is reproducible when running JVMTI in default mode, that is on Jitrino.JET. When running test on interpreter it shows correct offset of the bytecode.

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Updated: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

Posted by "Gregory Shimansky (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2926?page=all ]

Gregory Shimansky updated HARMONY-2926:
---------------------------------------

     Summary: [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset  (was: JVMTI Exception Callbacks reported at incorrect byte code offset)
    Assignee: Gregory Shimansky

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky commented on HARMONY-2926:
--------------------------------------------

Fixes applied at 502050.

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, harmony-2926.patch, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Commented: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky commented on HARMONY-2926:
--------------------------------------------

Actually I am wrong, in interpreter mode the catch location is incorrect. In JIT mode the throw location is incorrect. So these are 2 different bugs actually.

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Resolved: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky resolved HARMONY-2926.
----------------------------------------

    Resolution: Fixed

Regression test created in 502290.

When this regression test was ran on interpreter it has discovered another bug in interpreter support of JVMTI. When agent turns off Exception event inside of Exception event callback, interpreter went into an infinite loop. So this patch also includes a fix for interpreter code to handle this correctly.

Please check that the bug is gone for you.

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, harmony-2926.patch, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Updated: (HARMONY-2926) JVMTI Exception Callbacks reported at incorrect byte code offset

Posted by "Chris Elford (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2926?page=all ]

Chris Elford updated HARMONY-2926:
----------------------------------

    Attachment: bugshow.c

Simple JVMTI agent that registers for Exception events to demonstrate the bug.

compile via 

cl /LD /MD /IPATH_TO_JVMTI.H bugshow.c

> JVMTI Exception Callbacks reported at incorrect byte code offset
> ----------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>            Priority: Minor
>         Attachments: bugshow.c, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

Posted by "Chris Elford (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HARMONY-2926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12470336 ] 

Chris Elford commented on HARMONY-2926:
---------------------------------------

C:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
...
EXCEPTION: main(bc=0xf)->main(bc=0x13)
...

C:\java\drl\bin\java -agentlib:bugshow repro
...
EXCEPTION: main(bc=0xf)->main(bc=0x13)
...

looks correct to me in a version that includes this patch.  Thanks!  

Obviously, the patch is not in the harmony binary download yet as that version is from december.


> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, harmony-2926.patch, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Closed: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky closed HARMONY-2926.
--------------------------------------


VERIFIED

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, harmony-2926.patch, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Updated: (HARMONY-2926) [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset

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

Gregory Shimansky updated HARMONY-2926:
---------------------------------------

    Attachment: harmony-2926.patch

Interpreter had a bug when the catch location is always equal to IP of the stack trace where exception is propagated (always points to athrow or invoke bytecode).

In JIT mode things are more complicated. The athrow bytecode is translated into a helper call, and stack iterator points to an instruction after the helper call, which is a next bytecode. In this case IP has to be moved back for correct mapping. But when a hardware exception like NPE is generated, IP points to a correct instruction. So IP has to be moved back only in case the exception is thrown by athrow.

I think I've fixed this in attached patch. I am going to create a regression test and then commit the patch.

> [drlvm][jvmti] JVMTI Exception Callbacks reported at incorrect byte code offset
> -------------------------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: https://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>         Assigned To: Gregory Shimansky
>            Priority: Minor
>         Attachments: bugshow.c, harmony-2926.patch, repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

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


[jira] Updated: (HARMONY-2926) JVMTI Exception Callbacks reported at incorrect byte code offset

Posted by "Chris Elford (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2926?page=all ]

Chris Elford updated HARMONY-2926:
----------------------------------

    Attachment: repro.java

Reproducer java source

> JVMTI Exception Callbacks reported at incorrect byte code offset
> ----------------------------------------------------------------
>
>                 Key: HARMONY-2926
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2926
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>         Environment: Binary JRE release: harmony-jre-r487452
> 32bit windows XP SP2
>            Reporter: Chris Elford
>            Priority: Minor
>         Attachments: repro.java
>
>
> If one registers for Exception callbacks in JVMTI, the byte code offset reported for the throwing location is sometimes reported incorrectly 1 bytecode above where the exception is reported with other JVMs (e.g., Sun and BEA).  I will attach sample Java applicationand JVMTI agent code to reproduce.
> c:\java\bea50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\sun50_09_jre\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0xf)->main(bc=0x13)
> ...
> c:\java\hre50\bin\java -agentlib:bugshow repro
> ...
> EXCEPTION: main(bc=0x10)->main(bc=0x13)
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira