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

External dll not working since java 8u60

    • x86
    • windows_8

      FULL PRODUCT VERSION :
      Tried on jdk 8u60, 8u65 and 8u66, all with same behaviour, works in 8u51 and 7u79

      FULL OS VERSION :
      Windows 10 Professional N, 64bit.

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Ids imaging UEye camera driver version 4.50, 4.70, 4.71 and 4.72 tested.

      A DESCRIPTION OF THE PROBLEM :
      We are using an external dll (UEye driver) for a camera via JNA bindings, but since java version 8u60 the dll is no longer working correctly. Calling the bound C methods is not producing the correct behaviour.

      In all tested java versions before 8u60 the method initializes the camera and works, from 8u60 and forward it gives an error that the camera is not supported.

      When run outside the java vm environment it works every time, and it also works when used in java 7u79 and 8u51.

      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Yes

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      REGRESSION. Last worked in version 8u51

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Install uEye camera driver: https://en.ids-imaging.com/download-ueye-win64.html
      Have a uEye camera plugged into machine.
      Run test code.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Expected result is that the dll works and the camera can be initialized.

      Actual result is that the dll fails with an error code of NOT_SUPPORTED, but only in recent versions of java.
      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------

      import com.sun.jna.Native;
      import com.sun.jna.NativeLibrary;
      import com.sun.jna.Pointer;
      import com.sun.jna.ptr.IntByReference;

      public class Minimal {
          
          public static String JNA_LIBRARY_NAME = "uEye_api_64";
          
          public static final NativeLibrary NATIVE_LIB = NativeLibrary.getInstance(JNA_LIBRARY_NAME);

          static {
              Native.register(JNA_LIBRARY_NAME);
          }

          public static native int is_InitCamera(IntByReference handle, Pointer window);
          
          public static void testDll() {
              //Try to init next available uEye camera.
              int status = is_InitCamera(new IntByReference(0), Pointer.NULL);
              
              switch (status) {
                  case 0: //IS_SUCCESS
                      System.out.println("Success");
                      break;
                  case 155: //IS_NOT_SUPPORTED (Ie the bug, if correct camera is present)
                      System.out.println("Dll bug!");
                      break;
                  default: //Other
                      System.out.println("Some other return code, probabely no uEye camera present");
                      break;
              }
          }
          
          public static void main(String[] args) {
              testDll();
          }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Downgrading java to a version of 8u51 or lower. (Any java 7 version seems to work)

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: