Harmony
  1. Harmony
  2. HARMONY-2504

[drlvm] enforce structurted locking behaviour

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      Thread makes monitorenter, and throws exception (NPE) to the output.
      java.lang.IllegalMonitorStateException expected to appear at the output
      (because, according to the specification, the last exception should appear).
      Then other thread tries to get a lock.
      DRLVM hangs up. It's throws NPE instead of IllegalMonitorStateException and does not release the
      lock.

      1. Harmony-2504test.zip
        2 kB
        Alexander D Shipilov

        Activity

        Hide
        Alexander D Shipilov added a comment -

        Zip-file contains:
        sources:
        1 java-file
        1 jasmin file (http://jasmin.sourceforge.net/)
        and
        2 class-files from this sources

        Show
        Alexander D Shipilov added a comment - Zip-file contains: sources: 1 java-file 1 jasmin file ( http://jasmin.sourceforge.net/ ) and 2 class-files from this sources
        Hide
        Alexei Zakharov added a comment -

        adding [drlvm] prefix to summary

        Show
        Alexei Zakharov added a comment - adding [drlvm] prefix to summary
        Hide
        Evgueni Brevnov added a comment -

        I looked into the attached archive but it seems to be incomplete where is Test2.java?

        Evgueni

        Show
        Evgueni Brevnov added a comment - I looked into the attached archive but it seems to be incomplete where is Test2.java? Evgueni
        Hide
        Alexander D Shipilov added a comment -

        Evgueni,
        Test2.class should be compiled from Test2.j source. Jasmin compiler should be used. It is a java-assembler language. Test2 couldn't be compiled using common java language. You can use already compiled Test2.class in the attachement.

        Alexander

        Show
        Alexander D Shipilov added a comment - Evgueni, Test2.class should be compiled from Test2.j source. Jasmin compiler should be used. It is a java-assembler language. Test2 couldn't be compiled using common java language. You can use already compiled Test2.class in the attachement. Alexander
        Hide
        Alexey Varlamov added a comment -

        Alexander,
        Could you please clarify why you expect IllegalMonitorStateException?
        As for the deadlock, I believe it works as expected, see JVM specification paragraph 7.14, which hints that monitorexit should be guarded via try/finally block.
        BTW, BEA's JRockit 1.5 behaves exactly as drlvm.

        Show
        Alexey Varlamov added a comment - Alexander, Could you please clarify why you expect IllegalMonitorStateException? As for the deadlock, I believe it works as expected, see JVM specification paragraph 7.14, which hints that monitorexit should be guarded via try/finally block. BTW, BEA's JRockit 1.5 behaves exactly as drlvm.
        Hide
        Alexander D Shipilov added a comment -

        Alexey, I steel belive that Vm shouldn't hangs up even if it is bad try/catch block without finally. I think that it is better to ask community.

        Show
        Alexander D Shipilov added a comment - Alexey, I steel belive that Vm shouldn't hangs up even if it is bad try/catch block without finally. I think that it is better to ask community.
        Hide
        Alexey Varlamov added a comment -

        Sure, feel free to appeal on dev@. Please try to provide specific arguments, why and how it should work. My POV that VM must hang while executing a code which is designed to hang.

        Show
        Alexey Varlamov added a comment - Sure, feel free to appeal on dev@. Please try to provide specific arguments, why and how it should work. My POV that VM must hang while executing a code which is designed to hang.
        Hide
        Alexey Varlamov added a comment -

        Updated the issue accordingly to feedback from dev@.
        This may be considered as RI compatibilty issue thus has lower priority. Possible ways to fix:

        • issue warnings during verification on Java code breaking structured locking;
        • do post-mortem releasing of held monitors.
        Show
        Alexey Varlamov added a comment - Updated the issue accordingly to feedback from dev@. This may be considered as RI compatibilty issue thus has lower priority. Possible ways to fix: issue warnings during verification on Java code breaking structured locking; do post-mortem releasing of held monitors.

          People

          • Assignee:
            weldon washburn
            Reporter:
            Alexander D Shipilov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development