Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6361259

Java 1.6 MonitorExit clears exception thrown in native code

    Details

    • Subcomponent:
    • Introduced In Build:
      b63
    • Introduced In Version:
      6
    • Resolved In Build:
      b66
    • CPU:
      x86
    • OS:
      solaris_nevada

      Description

      Calling MonitorExit after ThrowNew has the side effect of clearing the exception just thrown. This behavior does not match java 1.5. To reproduce using the attached files (a small test case):

      javac Test6.java
      javah Test6
      cc -G -I/usr/j2se/include -I/usr/j2se/include/solaris Test6.c -o libtest6.so
      LD_LIBRARY_PATH=. java Test6

      Switching the order of these lines
              (*env)->ThrowNew(env, jxc, "error");
              (*env)->MonitorExit(env, jc);
      in Test6.c, or reverting to Java 1.5 causes the exception stack trace to print on the console as expected.

      The version of Java was obtained from /net/koori.sfbay/onestop/jdk/6/promoted/latest/bundles/solaris-i586/pkgarchive
      Dec 8, 2005

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ksrini Kumar Srinivasan
                Reporter:
                teericks Thomas Erickson (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: