You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Elena Sayapina (JIRA)" <ji...@apache.org> on 2007/06/06 07:58:26 UTC

[jira] Created: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

[drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
--------------------------------------------------------------------------------------------------------------------------------------------

                 Key: HARMONY-4053
                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
             Project: Harmony
          Issue Type: Bug
          Components: DRLVM
            Reporter: Elena Sayapina
         Attachments: reproduce.zip

Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

This issue caused the failures of 11 test cases from Geronimo unit test suite.

Affected tests:
org.apache.geronimo.gjndi.JavaCompContextTest
org.apache.geronimo.gjndi.JavaCompGBeanTest
org.apache.geronimo.gjndi.KernelContextGBeanTest

According J2SE VM specification:

"4.7.3 The Code Attribute
...
Each exception_table entry contains the following four items: 
start_pc, end_pc 
The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "

But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.

Please, use the code below for reproducing: 

------------------------------------- Verify.java --------------------------------------

public class Verify {

            public static void main(String[] args) throws ClassNotFoundException {
                        try {
                                   Class cl = Class.forName("test");
                                   System.out.println("TEST PASSED");
                        } catch (Throwable e) {
                                   System.out.println("TEST FAILED: unexpected " + e);
                        }
            }
}

------------------------------------- test.ccode--------------------------------------

magic = xCAFEBABE
minor_version = 3
major_version = 45
constant_pool_count = 13

constant_pool {
  /* #1 */ Method = #12 #6
  /* #2 */ UTF8 = "java/lang/Object"
  /* #3 */ UTF8 = "SourceFile"
  /* #4 */ UTF8 = "<init>"
  /* #5 */ Class = #11
  /* #6 */ NameAndType = #4 #10
  /* #7 */ UTF8 = "Code"
  /* #8 */ UTF8 = "test.ccode"
  /* #9 */ UTF8 = "test"
  /* #10 */ UTF8 = "()V"
  /* #11 */ UTF8 = "test"
  /* #12 */ Class = #2
}

access_flags = PUBLIC SUPER  // x21
this_class = #5  // "test"
super_class = #12  // "java/lang/Object"
interfaces_count = 0

interfaces {
}

fields_count = 0
methods_count = 2

methods {
  method {
    access_flag = PUBLIC  // x01
    name_index = #4  // "<init>"
    descriptor_index = #10  // "()V"
    attributes_count = 1

      attributes {
        attribute Code {
          attribute_name_index = #7  // "Code"
          attribute_length = 17
          max_stack = 1
          max_locals = 1
          code_length = 5

          code asm {
          0:           aload_0
          1:           invokespecial #1
          4:           return
          }

          exception_table_length = 0
          attributes_count = 0
        }
      }
  }

// Test method

  method {
    access_flag = PUBLIC  // x01
    name_index = #9  // "test"
    descriptor_index = #10  // "()V"
    attributes_count = 1
      attributes {
        attribute Code {
          attribute_name_index = #7  // "Code"
          attribute_length = 35
          max_stack = 2
          max_locals = 2
          code_length = 15

          code asm {
          0:           sipush 1
          3:           pop
          4:           return
          5:           sipush 2
          8:           pop
          9:           return
          10:         sipush 3
          13:         pop
          14:         return
          }

          exception_table_length = 1
          exception_table {
            // start_pc end_pc handler_pc catch_type 
            0 15 10 0   // end_pc is equal to code_length
          }
          attributes_count = 0
        }
      }
  }
}

attributes_count = 1

attributes {

  attribute SourceFile {
    attribute_name_index = #3  // "SourceFile"
    attribute_length = 2
    sourcefile_index = #8  // "test.ccode"
  }
}

-----------------------------------------------------------------------------------------------

test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
reproduce.zip contains test and Verify class files.

Output on Harmony-r544727:

Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
as applicable.
java version "1.5.0"
pre-alpha : not complete or compatible
svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
http://harmony.apache.org

TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
ion handler parameters [0, 15, 10] are out of instruction set


Output on RI:

java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

TEST PASSED



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


[jira] Commented: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Alexei Fedotov commented on HARMONY-4053:
-----------------------------------------

All tests passed, please commit the patch.

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Updated: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Alexei Fedotov updated HARMONY-4053:
------------------------------------

    Attachment: fix_one_if.patch

The fix is attached,

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Commented: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Gregory Shimansky commented on HARMONY-4053:
--------------------------------------------

Regression test committed at 547331.

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>            Assignee: Gregory Shimansky
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Commented: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Alexei Fedotov commented on HARMONY-4053:
-----------------------------------------

The bug is fixed. I will report when a test run finishes.

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Updated: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Elena Sayapina updated HARMONY-4053:
------------------------------------

    Attachment: reproduce.zip

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: reproduce.zip
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Closed: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Elena Sayapina closed HARMONY-4053.
-----------------------------------


Verified using Harmony-r548930-msvc-release. 
Verify test and 3 original Geronimo unit tests passed on this build.


> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>            Assignee: Gregory Shimansky
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Assigned: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Gregory Shimansky reassigned HARMONY-4053:
------------------------------------------

    Assignee: Gregory Shimansky

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>            Assignee: Gregory Shimansky
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Resolved: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Gregory Shimansky resolved HARMONY-4053.
----------------------------------------

    Resolution: Fixed

Patch has been applied at 547330. Please check that the bug is fixed for you.

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>            Assignee: Gregory Shimansky
>         Attachments: fix_one_if.patch, reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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


[jira] Updated: (HARMONY-4053) [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array

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

Alexei Fedotov updated HARMONY-4053:
------------------------------------

    Attachment: test.patch

Here is a regression test for the issue.

> [drlvm][verifier] Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> --------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4053
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4053
>             Project: Harmony
>          Issue Type: Bug
>          Components: DRLVM
>            Reporter: Elena Sayapina
>         Attachments: reproduce.zip, test.patch
>
>
> Unexpected VerifyError is thrown if end_pc from exception table of code attribute is equal to the length of the code array
> This issue caused the failures of 11 test cases from Geronimo unit test suite.
> Affected tests:
> org.apache.geronimo.gjndi.JavaCompContextTest
> org.apache.geronimo.gjndi.JavaCompGBeanTest
> org.apache.geronimo.gjndi.KernelContextGBeanTest
> According J2SE VM specification:
> "4.7.3 The Code Attribute
> ...
> Each exception_table entry contains the following four items: 
> start_pc, end_pc 
> The values of the two items start_pc and end_pc indicate the ranges in the code array at which the exception handler is active. The value of start_pc must be a valid index into the code array of the opcode of an instruction. The value of end_pc either must be a valid index into the code array of the opcode of an instruction or must be equal to code_length, the length of the code array ... "
> But DRLVM throws VerifyError if ending point in exception table is equal to the length of the code array.
> Please, use the code below for reproducing: 
> ------------------------------------- Verify.java --------------------------------------
> public class Verify {
>             public static void main(String[] args) throws ClassNotFoundException {
>                         try {
>                                    Class cl = Class.forName("test");
>                                    System.out.println("TEST PASSED");
>                         } catch (Throwable e) {
>                                    System.out.println("TEST FAILED: unexpected " + e);
>                         }
>             }
> }
> ------------------------------------- test.ccode--------------------------------------
> magic = xCAFEBABE
> minor_version = 3
> major_version = 45
> constant_pool_count = 13
> constant_pool {
>   /* #1 */ Method = #12 #6
>   /* #2 */ UTF8 = "java/lang/Object"
>   /* #3 */ UTF8 = "SourceFile"
>   /* #4 */ UTF8 = "<init>"
>   /* #5 */ Class = #11
>   /* #6 */ NameAndType = #4 #10
>   /* #7 */ UTF8 = "Code"
>   /* #8 */ UTF8 = "test.ccode"
>   /* #9 */ UTF8 = "test"
>   /* #10 */ UTF8 = "()V"
>   /* #11 */ UTF8 = "test"
>   /* #12 */ Class = #2
> }
> access_flags = PUBLIC SUPER  // x21
> this_class = #5  // "test"
> super_class = #12  // "java/lang/Object"
> interfaces_count = 0
> interfaces {
> }
> fields_count = 0
> methods_count = 2
> methods {
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #4  // "<init>"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 17
>           max_stack = 1
>           max_locals = 1
>           code_length = 5
>           code asm {
>           0:           aload_0
>           1:           invokespecial #1
>           4:           return
>           }
>           exception_table_length = 0
>           attributes_count = 0
>         }
>       }
>   }
> // Test method
>   method {
>     access_flag = PUBLIC  // x01
>     name_index = #9  // "test"
>     descriptor_index = #10  // "()V"
>     attributes_count = 1
>       attributes {
>         attribute Code {
>           attribute_name_index = #7  // "Code"
>           attribute_length = 35
>           max_stack = 2
>           max_locals = 2
>           code_length = 15
>           code asm {
>           0:           sipush 1
>           3:           pop
>           4:           return
>           5:           sipush 2
>           8:           pop
>           9:           return
>           10:         sipush 3
>           13:         pop
>           14:         return
>           }
>           exception_table_length = 1
>           exception_table {
>             // start_pc end_pc handler_pc catch_type 
>             0 15 10 0   // end_pc is equal to code_length
>           }
>           attributes_count = 0
>         }
>       }
>   }
> }
> attributes_count = 1
> attributes {
>   attribute SourceFile {
>     attribute_name_index = #3  // "SourceFile"
>     attribute_length = 2
>     sourcefile_index = #8  // "test.ccode"
>   }
> }
> -----------------------------------------------------------------------------------------------
> test class file can be created using VMTT tool from http://issues.apache.org/jira/browse/HARMONY-3206 
> reproduce.zip contains test and Verify class files.
> Output on Harmony-r544727:
> Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache Software Foundation or its licensors,
> as applicable.
> java version "1.5.0"
> pre-alpha : not complete or compatible
> svn = r544727, (Jun  6 2007), Windows/ia32/msvc 1310, release build
> http://harmony.apache.org
> TEST FAILED: unexpected java.lang.VerifyError: (class: test, method: test()V) At least one of except
> ion handler parameters [0, 15, 10] are out of instruction set
> Output on RI:
> java version "1.5.0_11"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
> Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)
> TEST PASSED

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