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

jvm.dll from jdk/jre 1.3.1.0(1,2,3,4) on win 2000 causes a crash - stack corrupt

XMLWordPrintable

    • x86
    • windows_2000

      Customer claims that 1.4.0_01 does show the problem

      Customer needs a fix in 1.3.1.0x release. Please see justification.

      Using jvm.dll from JDK/JRE 1.3.1_04 on Windows 2000 causes a process to crash
      (due to stack corruption) when the following code is executed:
      typedef jint (JNICALL *FuncCreateVM)(JavaVM**, void**, void*);
      typedef jint (JNICALL *FuncGetDefaultArgs)(void*);

      HINSTANCE hJavaDLL = LoadLibrary("C:\\jdk1.3.1_04\\jre\\bin\\hotjava\\jvm.dll");

      //HINSTANCE hJavaDLL = LoadLibrary("C:\\Program Files\\Java\\j2re1.4.0_01\\bin\\client\\jvm.dll");

      if (hJavaDLL != NULL)

      {

         FuncGetDefaultArgs pArgsFunc =

            (FuncGetDefaultArgs)GetProcAddress(hJavaDLL, "JNI_GetDefaultJavaVMInitArgs");

         if (pArgsFunc != NULL)

         {

            FuncCreateVM pFunc =

               (FuncCreateVM)GetProcAddress(hJavaDLL, "JNI_CreateJavaVM");

            if (pFunc != NULL)

            {

               JavaVM* p_vm = NULL;

               void* p_env = NULL;

               JavaVMInitArgs vm_args;

        

               int result2 =(*pArgsFunc)(&vm_args);

        

               vm_args.version = JNI_VERSION_1_2;

        

               int result =(*pFunc)(&p_vm, &p_env, &vm_args);

            }

         }

      }

      Reproducible Case:

      (1) The attached archive contains two sample Windows shell namespace extension projects and one Windows console application
      that can be used to drive them. Case #1 is encapsulated by the "SampView" project and its source code.

      To run the SampView sample, please do the following:

      1. Register this Windows shell namespace extension by double-clicking SampView\restoreSampView.reg

      2. In a Command Window, "ConsoleAppLoader\Debug\ConsoleAppLoader.exe SampView"

      3. Note the crash

      4. To unregister this Windows shell namespace extension, launch RegEdit and delete the following Windows Registry key:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{E2CB71D0-D2DC-11D1-B022-00600893AD51}

      Please see attachment for complete testcase.

            duke J. Duke
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: