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

System.load fails to load from paths containing unicode characters

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Won't Fix
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :


      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Calling System.load() on a path which contains one or more unicode characters will fail.



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Copy any DLL to a path containing unicode characters. This was first exhibited attempting to load from java.io.tmpdir on a user with a non-ascii username.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      DLL should load without errors.
      ACTUAL -
      UnsatisfiedLinkError is thrown, with varying error messages depending on windows version.

      This is likely due to System.load() using the ascii version of the LoadLibrary or LoadLibraryEx function in the w32 API.

      Note that IBM's J9 JVM does not exhibit this problem.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.UnsatisfiedLinkError: C:\tmp\testLoadFromUnicodePath-?????\mylib.dll: Can't find dependent libraries

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      File dll = new File( " C:\tmp\testLoadFromUnicodePath-?????/mylib.dll " );
      System.load(dll.getAbsolutePath());
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Load file from non-unicode path.

      This is problematic when attempting to load from a user-specific path and the user's name includes unicode characters.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sherman Xueming Shen
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: