Wrong object class or methodID passed to JNI call in TestSharedCloseJvmti with -Xshare:off

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • None
    • Affects Version/s: 26
    • Component/s: core-libs
    • None

      The new test java/foreign/sharedclosejvmti/TestSharedCloseJvmti.java fails when running without CDS:
      make run-test TEST=test/jdk/java/foreign/sharedclosejvmti/TestSharedCloseJvmti.java JTREG="VM_OPTIONS=-Xshare:off"

      STDERR:
      [14:00:40.711] STARTED TestSharedCloseJvmti::eventDuringScopedAccess 'eventDuringScopedAccess()'
      [fork] Exception in thread "main" java.lang.NoClassDefFoundError: TestSharedCloseJvmti$EventDuringScopedAccessRunner
       stdout: [FATAL ERROR in native method: Wrong object class or methodID passed to JNI call

      jni_env->FindClass(TARGET_CLASS_NAME) returns nullptr because of NoClassDefFoundError while trying to find "TestSharedCloseJvmti$EventDuringScopedAccessRunner". That's why MAIN_CLS and TARGET_ID don't get initialized in `start`.

        1. run.sh
          0.3 kB
        2. Main.java
          0.1 kB
        3. agent.cpp
          0.8 kB

            Assignee:
            Jorn Vernee
            Reporter:
            Martin Doerr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: