Harmony
  1. Harmony
  2. HARMONY-6449

[classlib][instrument] 3 failures in HelloWorldTest

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.0M2, 5.0M14
    • Component/s: None
    • Labels:
      None

      Description

      There are 3 failures in org.apache.harmony.tests.java.lang.instrument.HelloWorldTest that fail consistently on both the java 5 and 6 streams:

      testHelloWorld - expected:<0> but was:<3> at org.apache.harmony.tests.java.lang.instrument.HelloWorldTest.testHelloWorld(HelloWorldTest.java:56)
      testMultiLineValue - expected:<0> but was:<3> at org.apache.harmony.tests.java.lang.instrument.HelloWorldTest.testMultiLineValue(HelloWorldTest.java:75)
      testInvalidMultiLineValue - AssertionFailedError: null at org.apache.harmony.tests.java.lang.instrument.HelloWorldTest.testInvalidMultiLineValue(HelloWorldTest.java:95)

      These failures have been discussed on the dev list but are not yet resolved: http://markmail.org/message/owmi365iowmracqo

        Activity

        Hide
        Mark Hindess added a comment -

        This only failed for me on linux/32bit builds running on 32-bit - the same build would work on 64-bit. However, this now passes for me. I wonder what changed. It would be good to find out before closing this.

        Show
        Mark Hindess added a comment - This only failed for me on linux/32bit builds running on 32-bit - the same build would work on 64-bit. However, this now passes for me. I wonder what changed. It would be good to find out before closing this.
        Hide
        Oliver Deakin added a comment -

        I no longer see these tests failing on Windows x86.

        Show
        Oliver Deakin added a comment - I no longer see these tests failing on Windows x86.
        Hide
        Regis Xu added a comment -

        It's on x86

        Show
        Regis Xu added a comment - It's on x86
        Hide
        Oliver Deakin added a comment -

        Hi Regis - is that x86 or x86_64?

        Show
        Oliver Deakin added a comment - Hi Regis - is that x86 or x86_64?
        Hide
        Regis Xu added a comment -

        The there tests are passed with DRLVM on my Linux machine, Ubuntu 9.10.

        can_redefine_classes capability is updated to "1" if vm support it (via jvmti->GetPotentialCapabilities) and "can-redefine-classes" property is set "true" in agent jar's "META-INF/MANIFEST.MF".

        Show
        Regis Xu added a comment - The there tests are passed with DRLVM on my Linux machine, Ubuntu 9.10. can_redefine_classes capability is updated to "1" if vm support it (via jvmti->GetPotentialCapabilities) and "can-redefine-classes" property is set "true" in agent jar's "META-INF/MANIFEST.MF".
        Hide
        Oliver Deakin added a comment -

        I notice that jvmti_capability.cpp defines can_redefine_classes=0 in all modes, indicating that DRLVM does not support class redefinition. I found HARMONY-3305 was raised for this issue but appears never to have been resolved. This could be the reason the tests fail on DRL but pass on the IBM VME (which supports class redefinition).

        Show
        Oliver Deakin added a comment - I notice that jvmti_capability.cpp defines can_redefine_classes=0 in all modes, indicating that DRLVM does not support class redefinition. I found HARMONY-3305 was raised for this issue but appears never to have been resolved. This could be the reason the tests fail on DRL but pass on the IBM VME (which supports class redefinition).
        Hide
        Oliver Deakin added a comment -

        It doesn't remove the lines, it just moves them later on in the same function including the commented out FIXME. When I revert that commit I get crashes running the HelloWorld tests, after the commit I get the ABORT messages (Element was inserted second time in MapEx!).

        It looks like the error line is coming from hashtable.h in drlvm:

        if (pr.second)
        return &(pr.first->second);
        else

        { DIE(( "Element was inserted second time in MapEx!")); return NULL; // not reachable; to satisfy compiler warning }

        DRLVM is returning can_redefine_any_class as 0 and we're not changing that flag in the instrument code, so that seems ok. However, the MapEx class is only referenced from classloader code, so it's quite likely that class redefinition is causing the problem.

        Show
        Oliver Deakin added a comment - It doesn't remove the lines, it just moves them later on in the same function including the commented out FIXME. When I revert that commit I get crashes running the HelloWorld tests, after the commit I get the ABORT messages (Element was inserted second time in MapEx!). It looks like the error line is coming from hashtable.h in drlvm: if (pr.second) return &(pr.first->second); else { DIE(( "Element was inserted second time in MapEx!")); return NULL; // not reachable; to satisfy compiler warning } DRLVM is returning can_redefine_any_class as 0 and we're not changing that flag in the instrument code, so that seems ok. However, the MapEx class is only referenced from classloader code, so it's quite likely that class redefinition is causing the problem.
        Hide
        Mark Hindess added a comment -

        I assume this bug is related to the commit r888739 which looks rather odd in that it removes these lines:

        • //FIXME VM doesnot support the capbility right now.
        • //capabilities.can_redefine_any_class = 1;

        but does not fix anything in DRLVM. It looks like the intention is to ask the VM about capabilities but perhaps there is a logic error and it is assume the VM supports it when it doesn't - perhaps the VM even says it does when it doesn't.

        Just guessing though.

        Show
        Mark Hindess added a comment - I assume this bug is related to the commit r888739 which looks rather odd in that it removes these lines: //FIXME VM doesnot support the capbility right now. //capabilities.can_redefine_any_class = 1; but does not fix anything in DRLVM. It looks like the intention is to ask the VM about capabilities but perhaps there is a logic error and it is assume the VM supports it when it doesn't - perhaps the VM even says it does when it doesn't. Just guessing though.
        Hide
        Mark Hindess added a comment -

        Moving to next release as these aren't regressions. The errors from the child processes for me are:

        Element was inserted second time in MapEx!

        Show
        Mark Hindess added a comment - Moving to next release as these aren't regressions. The errors from the child processes for me are: Element was inserted second time in MapEx!

          People

          • Assignee:
            Unassigned
            Reporter:
            Oliver Deakin
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development