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

Future EnableEvent of OBJECT_ALLOC event is ignored once it's disabled

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.3.1_03
    • Component/s: vm-legacy
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      03
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Not verified

      Backports

        Description

        OS: Win2K
        JDK: 1.3.1

        Enable JVMPI_EVENT_OBJECT_ALLOC, and disable it, and enable it again. Then this
        event is not sent. But classc VM is OK. This poroblem is only HotSpot VM problem.

        I implement the fix for bugid:4449231, but couldn't get the improvement.

        ------------------------------------------------------------------
        #include "jvmpi.h"

        JVMPI_Interface *jvmpi_interface;
        #define CALL(f) (jvmpi_interface->f)

        static void notify_event(JVMPI_Event *event)
        {
        switch(event->event_type) {
        case JVMPI_EVENT_OBJECT_ALLOC:
        print("object_alloc\n");
        break;
        default:
        break;
        }
        }

        JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM *jvm, char *options, void *erserved)
        {
        if((*jvm)->GetEnv(jvm, (void **)&jvmpi_interface, JVMPI_VERSION_1) < 0)
        return JNI_ERR;

        jvmpi_interface->NotifyEvent = notify_event;

        CALL(EnableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);
        CALL(DisableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);
        CALL(EnableEvent)(JVMPI_EVENT_OBJECT_ALLOC, NULL);

        return JNI_OK;
        }
        --------------------------------------------------------------------

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mchung Mandy Chung
                Reporter:
                mkamito Masaaki Kamito (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: