RVM
  1. RVM
  2. RVM-814

Wrong exception from Java reflection

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.0.1, hg tip
    • Fix Version/s: 3.1.0
    • Component/s: Runtime: Class Library
    • Labels:
      None
    • Environment:
      Intel IA32, Linux 2.6.27, Ubuntu 8.10
    • Testcase included:
      yes
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      It appears that Jikes RVM has a bug in the implementation of its reflection.
      For the detail, look at the patch and the test case: reflection.patch and
      Reflection.java. Try the following.

      1. To see the bug, try the following three command lines.

      $javac ReflectionTest.java

      $java -showversion ReflectionTest
      java version "1.6.0_10"
      Java(TM) SE Runtime Environment (build 1.6.0_10-b33)
      Java HotSpot(TM) Server VM (build 11.0-b15, mixed mode)

      newInstance: pass
      invokeVirtual: pass
      invokeStatic: pass

      $rvm ReflectionTest
      ...
      newInstance: pass
      invokeVirtual: fail
      unexpected cause of the Invocation target exception:
      java.lang.reflect.InvocationTargetException
      ...
      invokeStatic: fail
      unexpected cause of the Invocation target exception:

      2. To correct the bug, try the following.

      • Apply the patch: reflection.patch
      • Build Jikes RVM
      • Run it

      $rvm ReflectionTest
      newInstance: pass
      invokeVirtual: pass
      invokeStatic: pass

      1. reflection.patch
        3 kB
        Byeong Lee
      2. ReflectionTest.java
        4 kB
        Byeong Lee

        Activity

        Byeong Lee made changes -
        Field Original Value New Value
        Attachment ReflectionTest.java [ 41347 ]
        Attachment reflection.patch [ 41346 ]
        Byeong Lee made changes -
        Attachment reflection.patch [ 41341 ]
        Byeong Lee made changes -
        Attachment ReflectionTest.java [ 41340 ]
        David Grove made changes -
        Priority Major [ 3 ] Critical [ 2 ]
        Hide
        Ian Rogers added a comment -

        Also tracked with a better break down of the actual problem in MRP: http://jira.codehaus.org/browse/MRP-3

        Show
        Ian Rogers added a comment - Also tracked with a better break down of the actual problem in MRP: http://jira.codehaus.org/browse/MRP-3
        Hide
        Filip Pizlo added a comment -

        Patch committed in r15700.

        Show
        Filip Pizlo added a comment - Patch committed in r15700.
        Filip Pizlo made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Hide
        Ian Rogers added a comment -

        Just FYI, MRP won't apply this patch as it is incorrect.

        Show
        Ian Rogers added a comment - Just FYI, MRP won't apply this patch as it is incorrect.
        Hide
        David Grove added a comment -

        testing alternate fix.

        Show
        David Grove added a comment - testing alternate fix.
        David Grove made changes -
        Status Resolved [ 5 ] Reopened [ 4 ]
        Resolution Fixed [ 1 ]
        Assignee David Grove [ dgrove ]
        Hide
        David Grove added a comment -

        alternate fix committed in r15701.

        Show
        David Grove added a comment - alternate fix committed in r15701.
        David Grove made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            David Grove
            Reporter:
            Byeong Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: