Java 1.6 MonitorExit clears exception thrown in native code

XMLWordPrintable

    • b63
    • 6
    • b66
    • x86
    • solaris_nevada

      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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: